// JavaScript source code
F.module("/static/common/ui/editor/addon/addon.js",
function(b, g) {
    var e = b("/static/common/lib/tangram/base/base.js");
    var a, c, f;
    function i() {
        var l = e("<div/>").addClass("ik-authcode-outer").appendTo(c).hide();
        var n = b("/static/common/ui/authcode/authcode.js");
        var m = false;
        a.instance.addListener("focus",
        function() {
            if (!m) {
                a.config.optionList.modify = true;
                if (!a.authcode) {
                    a.authcode = new n({
                        container: l,
                        from: f.authcode
                    })
                }
                m = true
            }
        })
    }
    function k() {
        var l = e('<a href="#"/>').addClass("btn btn-32-green grid-r").html("<em><b>" + (f.submitBtn || "\u786e\u5b9a") + "</b></em>").appendTo(c);
        if (a.type == "answer" || a.type == "modifyanswer") {
            l.attr("alog-action", "qb-ans-sb")
        }
        return l
    }
    function d() {
        var l = e('<input type="checkbox" name="md" />');
        e("<label/>").addClass("unname").attr({
            "alog-action": "qb-unname"
        }).append(l).append(e("<span/>").html("\u533f\u540d")).appendTo(c);
        return l
    }
    function h() {
        return e("<p/>").html(f.text).appendTo(c)
    }
    function j(l) {
        if (! (l && l.config && l.style)) {
            return
        }
        a = l;
        f = l.style.addons;
        c = a.addonsContainer = e("<div/>").addClass("addons line").appendTo(a.container);
        if (f.authcode) {
            i()
        }
        if (f.anonymouse && l.style.isLogin) {
            a.anonymouse = d()
        }
        if (f.submitBtn) {
            a.submitBtn = k()
        }
        if (f.text) {
            a.addtext = h()
        }
    }
    g.init = j;
    return g
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/authcode/authcode.js"]);
F.module("/static/common/ui/editor/config/config.js",
function(b, d) {
    var c = b("/static/common/lib/tangram/base/base.js");
    var i = b("/static/common/ui/uri/uri.js");
    var h = ['body{margin:0;padding:6px 8px;font:14px/20px arial,"\\5B8B\\4F53";cursor:text;}', "p{margin:1px 0;padding:0;cursor:text;word-wrap:break-word;vertical-align:baseline \\0;}", "p img{vertical-align:bottom;*vertical-align:-3px;}", "img{border:0;}", "iframe{width:430px;height:310px;border:1px solid #ccc;}", "#initContent{color:#ccc;}", "ol,ul{margin-top:0;margin-bottom:0;margin-left:0;padding-left:2em;}", "ol{*margin-left:2px;}", "body.view{padding:6px 8px;}", "strong{color:#4c4c4c;}", "em{font-style:normal;color:#e0435d;}", "strong em, em strong{color:#e0435d;}"];
    var e = window.location.pathname,
    g = window.UEDITOR_HOME_URL || e.substr(0, e.lastIndexOf("/") + 1).replace("_examples/", "").replace("website/", ""),
    a = "http://pp.zhidao.baidu.com";
    var f = {
        imageUrl: a + "/submit/ajax/",
        imageFieldName: "image",
        imagePath: "",
        imageMaxSize: "5",
        waitImageUrl: "http://img.baidu.com/img/iknow/editor/uploading.gif",
        indexFlagFieldName: "position",
        flashUrl: "/flash/zhidao.swf",
        imgFlashWidth: 48,
        imgFlashHeight: 22,
        maxImagesCount: 20,
        langPath: null,
        themePath: null,
        customObj: {
            cm: 100672,
            encryptedBDUSS: F.context("user").encryptedBDUSS || null
        },
        heightIncrement: 0,
        isLogin: true,
        acceptImageType: "*.jpg;*.png;*.gif;*.bmp",
        className: "iknow-editor",
        autoSaveEnabled: true,
        autoSaveFrequency: 60,
        toolbars: [["insertimage", "|", "insertunorderedlist", "|", "insertorderedlist", "|", "autotypeset", "|", "insertmap"]],
        buttonConfig: {},
        insertcode: {
            as3: "ActionScript3",
            bash: "Bash/Shell",
            cpp: "C/C++",
            css: "Css",
            csharp: "C#",
            delphi: "Delphi",
            groovy: "Groovy",
            html: "Html",
            java: "Java",
            js: "Javascript",
            pl: "Perl",
            php: "Php",
            python: "Python",
            ruby: "Ruby",
            scala: "Scala",
            sql: "Sql",
            vb: "Vb",
            xml: "Xml"
        },
        initialStyle: h.join(""),
        iframeCssUrl: "",
        initialContent: "",
        autoClearinitialContent: true,
        maxUndoCount: 20,
        maxInputCount: 20,
        pasteplain: true,
        textarea: "editorValue",
        focus: false,
        minFrameHeight: 190,
        maxFrameHeight: 420,
        initialFrameHeight: 190,
        initialMaxFrameHeight: 420,
        autoHeightEnabled: true,
        enterTag: "p",
        wordCount: true,
        maximumWords: 1499,
        tabSize: 4,
        tabNode: "&nbsp;",
        zIndex: 0,
        readonly: false,
        messages: {
            wordCountMsg: "\u60a8\u8fd8\u53ef\u4ee5\u8f93\u5165{#leave} \u4e2a\u5b57",
            wordOverFlowMsg: "\u8f93\u5165\u5185\u5bb9\u5df2\u7ecf\u8fbe\u5230\u957f\u5ea6\u9650\u5236\uff0c\u8bf7\u5220\u51cf"
        },
        autotypeset: {
            mergeEmptyline: true,
            indent: true,
            indentValue: "2em"
        },
        serialize: {
            blackList: {
                style: 1,
                link: 1,
                object: 1,
                applet: 1,
                input: 1,
                meta: 1,
                base: 1,
                button: 1,
                select: 1,
                textarea: 1,
                "#comment": 1,
                map: 1,
                area: 1
            }
        },
        UEDITOR_HOME_URL: g,
        swfUploadFlashUrl: i.fileUploaderSwf,
        swfUploadUrl: "https://pcs.baidu.com/rest/2.0/pcs/file?method=upload&app_id=598913&response-status=200&ondup=newcopy",
        swfUploadDir: "/apps/\u767e\u5ea6\u77e5\u9053/",
        swfUploadPostName: "file",
        WP_KEY: "598913",
        wealthList: [{
            key: "0",
            value: "\u514d\u8d39"
        },
        {
            key: "1",
            value: "1 \u8d22\u5bcc\u503c"
        },
        {
            key: "2",
            value: "2 \u8d22\u5bcc\u503c"
        },
        {
            key: "3",
            value: "3 \u8d22\u5bcc\u503c"
        },
        {
            key: "4",
            value: "4 \u8d22\u5bcc\u503c"
        },
        {
            key: "5",
            value: "5 \u8d22\u5bcc\u503c"
        }]
    };
    d = f;
    return d
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/uri/uri.js"]);
F.module("/static/common/ui/editor/lang/lang.js",
function(c, a) {
    var b = {};
    b["zh-cn"] = {
        insertorderedlist: {
            num: "1,2,3...",
            num1: "1),2),3)...",
            num2: "(1),(2),(3)...",
            cn: "\u4e00,\u4e8c,\u4e09....",
            cn1: "\u4e00),\u4e8c),\u4e09)....",
            cn2: "(\u4e00),(\u4e8c),(\u4e09)....",
            decimal: "1,2,3...",
            "lower-alpha": "a,b,c...",
            "lower-roman": "i,ii,iii...",
            "upper-alpha": "A,B,C...",
            "upper-roman": "I,II,III..."
        },
        insertunorderedlist: {
            circle: "\u25cb \u5927\u5706\u5708",
            disc: "\u25cf \u5c0f\u9ed1\u70b9",
            square: "\u25a0 \u5c0f\u65b9\u5757 ",
            dash: "\u2014 \u7834\u6298\u53f7",
            dot: " \u3002 \u5c0f\u5706\u5708"
        },
        wordCountTip: "",
        wordCountMsg: "",
        wordOverFlowMsg: '<span class="f-red">\u5b57\u6570\u8d85\u51fa\u6700\u5927\u5141\u8bb8\u503c\uff0c\u8bf7\u5220\u51cf\uff01</span>',
        ok: "\u786e\u8ba4",
        cancel: "\u53d6\u6d88",
        closeDialog: "\u5173\u95ed\u5bf9\u8bdd\u6846",
        tableDrag: "\u8868\u683c\u62d6\u52a8\u5fc5\u987b\u5f15\u5165uiUtils.js\u6587\u4ef6\uff01",
        autofloatMsg: "\u5de5\u5177\u680f\u6d6e\u52a8\u4f9d\u8d56\u7f16\u8f91\u5668UI\uff0c\u60a8\u9996\u5148\u9700\u8981\u5f15\u5165UI\u6587\u4ef6!",
        confirmClear: "\u786e\u5b9a\u6e05\u7a7a\u5f53\u524d\u6587\u6863\u4e48\uff1f",
        anthorMsg: "\u94fe\u63a5",
        clearColor: "\u6e05\u7a7a\u989c\u8272",
        standardColor: "\u6807\u51c6\u989c\u8272",
        themeColor: "\u4e3b\u9898\u989c\u8272",
        insertcodetitle: "\u4ee3\u7801\u8bed\u8a00",
        property: "\u5c5e\u6027",
        "default": "\u9ed8\u8ba4",
        modify: "\u4fee\u6539",
        justifyleft: "\u5de6\u5bf9\u9f50",
        justifyright: "\u53f3\u5bf9\u9f50",
        justifycenter: "\u5c45\u4e2d",
        justify: "\u9ed8\u8ba4",
        clear: "\u6e05\u9664",
        anchorMsg: "\u951a\u70b9",
        "delete": "\u5220\u9664",
        clickToUpload: "\u70b9\u51fb\u4e0a\u4f20",
        unset: "\u5c1a\u672a\u8bbe\u7f6e\u8bed\u8a00\u6587\u4ef6",
        t_row: "\u884c",
        t_col: "\u5217",
        more: "\u66f4\u591a",
        pasteOpt: "\u7c98\u8d34\u9009\u9879",
        pasteSourceFormat: "\u4fdd\u7559\u6e90\u683c\u5f0f",
        tagFormat: "\u53ea\u4fdd\u7559\u6807\u7b7e",
        pasteTextFormat: "\u53ea\u4fdd\u7559\u6587\u672c",
        autoTypeSet: {
            mergeLine: "\u5408\u5e76\u7a7a\u884c",
            delLine: "\u6e05\u9664\u7a7a\u884c",
            removeFormat: "\u6e05\u9664\u683c\u5f0f",
            indent: "\u9996\u884c\u7f29\u8fdb",
            alignment: "\u5bf9\u9f50\u65b9\u5f0f",
            imageFloat: "\u56fe\u7247\u6d6e\u52a8",
            removeFontsize: "\u6e05\u9664\u5b57\u53f7",
            removeFontFamily: "\u6e05\u9664\u5b57\u4f53",
            removeHtml: "\u6e05\u9664\u5197\u4f59HTML\u4ee3\u7801",
            pasteFilter: "\u7c98\u8d34\u8fc7\u6ee4",
            run: "\u6267\u884c"
        }
    };
    a = b;
    return a
},
[]);
F.module("/static/common/ui/editor/fileUploader/fileUploader.js",
function(require, exports) {
    var T = require("/static/common/lib/tangram/base/base.js");
    var Dialog = require("/static/common/ui/dialog/dialog.js");
    var util = require("/static/common/ui/util/util.js");
    var SWFUpload;
    if (SWFUpload == undefined) {
        SWFUpload = function(settings) {
            this.initSWFUpload(settings)
        }
    }
    SWFUpload.prototype.initSWFUpload = function(settings) {
        try {
            this.customSettings = {};
            this.settings = settings;
            this.eventQueue = [];
            this.movieName = "SWFUpload_" + SWFUpload.movieCount++;
            this.movieElement = null;
            SWFUpload.instances[this.movieName] = this;
            this.initSettings();
            this.loadFlash()
        } catch(ex) {
            delete SWFUpload.instances[this.movieName];
            throw ex
        }
    };
    SWFUpload.instances = {};
    SWFUpload.movieCount = 0;
    SWFUpload.version = "2.2.0 2009-03-25";
    SWFUpload.QUEUE_ERROR = {
        QUEUE_LIMIT_EXCEEDED: -100,
        FILE_EXCEEDS_SIZE_LIMIT: -110,
        ZERO_BYTE_FILE: -120,
        INVALID_FILETYPE: -130
    };
    SWFUpload.UPLOAD_ERROR = {
        HTTP_ERROR: -200,
        MISSING_UPLOAD_URL: -210,
        IO_ERROR: -220,
        SECURITY_ERROR: -230,
        UPLOAD_LIMIT_EXCEEDED: -240,
        UPLOAD_FAILED: -250,
        SPECIFIED_FILE_ID_NOT_FOUND: -260,
        FILE_VALIDATION_FAILED: -270,
        FILE_CANCELLED: -280,
        UPLOAD_STOPPED: -290
    };
    SWFUpload.FILE_STATUS = {
        QUEUED: -1,
        IN_PROGRESS: -2,
        ERROR: -3,
        COMPLETE: -4,
        CANCELLED: -5
    };
    SWFUpload.BUTTON_ACTION = {
        SELECT_FILE: -100,
        SELECT_FILES: -110,
        START_UPLOAD: -120
    };
    SWFUpload.CURSOR = {
        ARROW: -1,
        HAND: -2
    };
    SWFUpload.WINDOW_MODE = {
        WINDOW: "window",
        TRANSPARENT: "transparent",
        OPAQUE: "opaque"
    };
    SWFUpload.completeURL = function(url) {
        if (typeof(url) !== "string" || url.match(/^https?:\/\//i) || url.match(/^\//)) {
            return url
        }
        var currentURL = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port: "");
        var indexSlash = window.location.pathname.lastIndexOf("/");
        if (indexSlash <= 0) {
            path = "/"
        } else {
            path = window.location.pathname.substr(0, indexSlash) + "/"
        }
        return path + url
    };
    SWFUpload.prototype.initSettings = function() {
        this.ensureDefault = function(settingName, defaultValue) {
            this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue: this.settings[settingName]
        };
        this.ensureDefault("upload_url", "");
        this.ensureDefault("preserve_relative_urls", false);
        this.ensureDefault("file_post_name", "Filedata");
        this.ensureDefault("post_params", {});
        this.ensureDefault("use_query_string", false);
        this.ensureDefault("requeue_on_error", false);
        this.ensureDefault("http_success", []);
        this.ensureDefault("assume_success_timeout", 0);
        this.ensureDefault("file_types", "*.*");
        this.ensureDefault("file_types_description", "All Files");
        this.ensureDefault("file_size_limit", 0);
        this.ensureDefault("file_upload_limit", 0);
        this.ensureDefault("file_queue_limit", 0);
        this.ensureDefault("flash_url", "swfupload.swf");
        this.ensureDefault("prevent_swf_caching", false);
        this.ensureDefault("button_image_url", "");
        this.ensureDefault("button_width", 1);
        this.ensureDefault("button_height", 1);
        this.ensureDefault("button_text", "");
        this.ensureDefault("button_text_style", "color: #000000; font-size: 16pt;");
        this.ensureDefault("button_text_top_padding", 0);
        this.ensureDefault("button_text_left_padding", 0);
        this.ensureDefault("button_action", SWFUpload.BUTTON_ACTION.SELECT_FILES);
        this.ensureDefault("button_disabled", false);
        this.ensureDefault("button_placeholder_id", "");
        this.ensureDefault("button_placeholder", null);
        this.ensureDefault("button_cursor", SWFUpload.CURSOR.ARROW);
        this.ensureDefault("button_window_mode", SWFUpload.WINDOW_MODE.WINDOW);
        this.settings.return_upload_start_handler = this.returnUploadStart;
        this.ensureDefault("swfupload_loaded_handler", null);
        this.ensureDefault("file_dialog_start_handler", null);
        this.ensureDefault("file_queued_handler", null);
        this.ensureDefault("file_queue_error_handler", null);
        this.ensureDefault("file_dialog_complete_handler", null);
        this.ensureDefault("upload_start_handler", null);
        this.ensureDefault("upload_progress_handler", null);
        this.ensureDefault("upload_error_handler", null);
        this.ensureDefault("upload_success_handler", null);
        this.ensureDefault("upload_complete_handler", null);
        this.ensureDefault("custom_settings", {});
        this.customSettings = this.settings.custom_settings;
        if ( !! this.settings.prevent_swf_caching) {
            this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?": "&") + "preventswfcaching=" + new Date().getTime()
        }
        if (!this.settings.preserve_relative_urls) {
            this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url)
        }
        delete this.ensureDefault
    };
    SWFUpload.prototype.loadFlash = function() {
        var targetElement, tempParent;
        if (document.getElementById(this.movieName) !== null) {
            throw "ID " + this.movieName + " is already in use. The Flash Object could not be added"
        }
        targetElement = document.getElementById(this.settings.button_placeholder_id) || this.settings.button_placeholder;
        if (targetElement == undefined) {
            throw "Could not find the placeholder element: " + this.settings.button_placeholder_id
        }
        tempParent = document.createElement("div");
        tempParent.innerHTML = this.getFlashHTML();
        targetElement.parentNode.replaceChild(tempParent.firstChild, targetElement);
        if (window[this.movieName] == undefined) {
            window[this.movieName] = this.getMovieElement()
        }
    };
    SWFUpload.prototype.getFlashHTML = function() {
        return ['<object id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">', '<param name="wmode" value="', this.settings.button_window_mode, '" />', '<param name="movie" value="', this.settings.flash_url, '" />', '<param name="quality" value="high" />', '<param name="menu" value="false" />', '<param name="allowScriptAccess" value="always" />', '<param name="flashvars" value="' + this.getFlashVars() + '" />', "</object>"].join("")
    };
    SWFUpload.prototype.getFlashVars = function() {
        var paramString = this.buildParamString();
        var httpSuccessString = this.settings.http_success.join(",");
        return ["movieName=", encodeURIComponent(this.movieName), "&amp;uploadURL=", encodeURIComponent(this.settings.upload_url), "&amp;useQueryString=", encodeURIComponent(this.settings.use_query_string), "&amp;requeueOnError=", encodeURIComponent(this.settings.requeue_on_error), "&amp;httpSuccess=", encodeURIComponent(httpSuccessString), "&amp;assumeSuccessTimeout=", encodeURIComponent(this.settings.assume_success_timeout), "&amp;params=", encodeURIComponent(paramString), "&amp;filePostName=", encodeURIComponent(this.settings.file_post_name), "&amp;fileTypes=", encodeURIComponent(this.settings.file_types), "&amp;fileTypesDescription=", encodeURIComponent(this.settings.file_types_description), "&amp;fileSizeLimit=", encodeURIComponent(this.settings.file_size_limit), "&amp;fileUploadLimit=", encodeURIComponent(this.settings.file_upload_limit), "&amp;fileQueueLimit=", encodeURIComponent(this.settings.file_queue_limit), "&amp;debugEnabled=", encodeURIComponent(this.settings.debug_enabled), "&amp;buttonImageURL=", encodeURIComponent(this.settings.button_image_url), "&amp;buttonWidth=", encodeURIComponent(this.settings.button_width), "&amp;buttonHeight=", encodeURIComponent(this.settings.button_height), "&amp;buttonText=", encodeURIComponent(this.settings.button_text), "&amp;buttonTextTopPadding=", encodeURIComponent(this.settings.button_text_top_padding), "&amp;buttonTextLeftPadding=", encodeURIComponent(this.settings.button_text_left_padding), "&amp;buttonTextStyle=", encodeURIComponent(this.settings.button_text_style), "&amp;buttonAction=", encodeURIComponent(this.settings.button_action), "&amp;buttonDisabled=", encodeURIComponent(this.settings.button_disabled), "&amp;buttonCursor=", encodeURIComponent(this.settings.button_cursor)].join("")
    };
    SWFUpload.prototype.getMovieElement = function() {
        if (this.movieElement == undefined) {
            this.movieElement = document.getElementById(this.movieName)
        }
        if (this.movieElement === null) {
            throw "Could not find Flash element"
        }
        return this.movieElement
    };
    SWFUpload.prototype.buildParamString = function() {
        var postParams = this.settings.post_params;
        var paramStringPairs = [];
        if (typeof(postParams) === "object") {
            for (var name in postParams) {
                if (postParams.hasOwnProperty(name)) {
                    paramStringPairs.push(encodeURIComponent(name.toString()) + "=" + encodeURIComponent(postParams[name].toString()))
                }
            }
        }
        return paramStringPairs.join("&amp;")
    };
    SWFUpload.prototype.destroy = function() {
        try {
            this.cancelUpload(null, false);
            var movieElement = null;
            movieElement = this.getMovieElement();
            if (movieElement && typeof(movieElement.CallFunction) === "unknown") {
                for (var i in movieElement) {
                    try {
                        if (typeof(movieElement[i]) === "function") {
                            movieElement[i] = null
                        }
                    } catch(ex1) {}
                }
                try {
                    movieElement.parentNode.removeChild(movieElement)
                } catch(ex) {}
            }
            window[this.movieName] = null;
            SWFUpload.instances[this.movieName] = null;
            delete SWFUpload.instances[this.movieName];
            this.movieElement = null;
            this.settings = null;
            this.customSettings = null;
            this.eventQueue = null;
            this.movieName = null;
            return true
        } catch(ex2) {
            return false
        }
    };
    SWFUpload.prototype.addSetting = function(name, value, default_value) {
        if (value == undefined) {
            return (this.settings[name] = default_value)
        } else {
            return (this.settings[name] = value)
        }
    };
    SWFUpload.prototype.getSetting = function(name) {
        if (this.settings[name] != undefined) {
            return this.settings[name]
        }
        return ""
    };
    SWFUpload.prototype.callFlash = function(functionName, argumentArray) {
        argumentArray = argumentArray || [];
        var movieElement = this.getMovieElement();
        var returnValue, returnString;
        try {
            returnString = movieElement.CallFunction('<invoke name="' + functionName + '" returntype="javascript">' + __flash__argumentsToXML(argumentArray, 0) + "</invoke>");
            returnValue = eval(returnString)
        } catch(ex) {
            throw "Call to " + functionName + " failed"
        }
        if (returnValue != undefined && typeof returnValue.post === "object") {
            returnValue = this.unescapeFilePostParams(returnValue)
        }
        return returnValue
    };
    SWFUpload.prototype.selectFile = function() {
        this.callFlash("SelectFile")
    };
    SWFUpload.prototype.selectFiles = function() {
        this.callFlash("SelectFiles")
    };
    SWFUpload.prototype.startUpload = function(fileID) {
        this.callFlash("StartUpload", [fileID])
    };
    SWFUpload.prototype.cancelUpload = function(fileID, triggerErrorEvent) {
        if (triggerErrorEvent !== false) {
            triggerErrorEvent = true
        }
        this.callFlash("CancelUpload", [fileID, triggerErrorEvent])
    };
    SWFUpload.prototype.stopUpload = function() {
        this.callFlash("StopUpload")
    };
    SWFUpload.prototype.getStats = function() {
        return this.callFlash("GetStats")
    };
    SWFUpload.prototype.setStats = function(statsObject) {
        this.callFlash("SetStats", [statsObject])
    };
    SWFUpload.prototype.getFile = function(fileID) {
        if (typeof(fileID) === "number") {
            return this.callFlash("GetFileByIndex", [fileID])
        } else {
            return this.callFlash("GetFile", [fileID])
        }
    };
    SWFUpload.prototype.addFileParam = function(fileID, name, value) {
        return this.callFlash("AddFileParam", [fileID, name, value])
    };
    SWFUpload.prototype.removeFileParam = function(fileID, name) {
        this.callFlash("RemoveFileParam", [fileID, name])
    };
    SWFUpload.prototype.setUploadURL = function(url) {
        this.settings.upload_url = url.toString();
        this.callFlash("SetUploadURL", [url])
    };
    SWFUpload.prototype.setPostParams = function(paramsObject) {
        this.settings.post_params = paramsObject;
        this.callFlash("SetPostParams", [paramsObject])
    };
    SWFUpload.prototype.addPostParam = function(name, value) {
        this.settings.post_params[name] = value;
        this.callFlash("SetPostParams", [this.settings.post_params])
    };
    SWFUpload.prototype.removePostParam = function(name) {
        delete this.settings.post_params[name];
        this.callFlash("SetPostParams", [this.settings.post_params])
    };
    SWFUpload.prototype.setFileTypes = function(types, description) {
        this.settings.file_types = types;
        this.settings.file_types_description = description;
        this.callFlash("SetFileTypes", [types, description])
    };
    SWFUpload.prototype.setFileSizeLimit = function(fileSizeLimit) {
        this.settings.file_size_limit = fileSizeLimit;
        this.callFlash("SetFileSizeLimit", [fileSizeLimit])
    };
    SWFUpload.prototype.setFileUploadLimit = function(fileUploadLimit) {
        this.settings.file_upload_limit = fileUploadLimit;
        this.callFlash("SetFileUploadLimit", [fileUploadLimit])
    };
    SWFUpload.prototype.setFileQueueLimit = function(fileQueueLimit) {
        this.settings.file_queue_limit = fileQueueLimit;
        this.callFlash("SetFileQueueLimit", [fileQueueLimit])
    };
    SWFUpload.prototype.setFilePostName = function(filePostName) {
        this.settings.file_post_name = filePostName;
        this.callFlash("SetFilePostName", [filePostName])
    };
    SWFUpload.prototype.setUseQueryString = function(useQueryString) {
        this.settings.use_query_string = useQueryString;
        this.callFlash("SetUseQueryString", [useQueryString])
    };
    SWFUpload.prototype.setRequeueOnError = function(requeueOnError) {
        this.settings.requeue_on_error = requeueOnError;
        this.callFlash("SetRequeueOnError", [requeueOnError])
    };
    SWFUpload.prototype.setHTTPSuccess = function(http_status_codes) {
        if (typeof http_status_codes === "string") {
            http_status_codes = http_status_codes.replace(" ", "").split(",")
        }
        this.settings.http_success = http_status_codes;
        this.callFlash("SetHTTPSuccess", [http_status_codes])
    };
    SWFUpload.prototype.setAssumeSuccessTimeout = function(timeout_seconds) {
        this.settings.assume_success_timeout = timeout_seconds;
        this.callFlash("SetAssumeSuccessTimeout", [timeout_seconds])
    };
    SWFUpload.prototype.setButtonImageURL = function(buttonImageURL) {
        if (buttonImageURL == undefined) {
            buttonImageURL = ""
        }
        this.settings.button_image_url = buttonImageURL;
        this.callFlash("SetButtonImageURL", [buttonImageURL])
    };
    SWFUpload.prototype.setButtonDimensions = function(width, height) {
        this.settings.button_width = width;
        this.settings.button_height = height;
        var movie = this.getMovieElement();
        if (movie != undefined) {
            movie.style.width = width + "px";
            movie.style.height = height + "px"
        }
        this.callFlash("SetButtonDimensions", [width, height])
    };
    SWFUpload.prototype.setButtonText = function(html) {
        this.settings.button_text = html;
        this.callFlash("SetButtonText", [html])
    };
    SWFUpload.prototype.setButtonTextPadding = function(left, top) {
        this.settings.button_text_top_padding = top;
        this.settings.button_text_left_padding = left;
        this.callFlash("SetButtonTextPadding", [left, top])
    };
    SWFUpload.prototype.setButtonTextStyle = function(css) {
        this.settings.button_text_style = css;
        this.callFlash("SetButtonTextStyle", [css])
    };
    SWFUpload.prototype.setButtonDisabled = function(isDisabled) {
        this.settings.button_disabled = isDisabled;
        this.callFlash("SetButtonDisabled", [isDisabled])
    };
    SWFUpload.prototype.setButtonAction = function(buttonAction) {
        this.settings.button_action = buttonAction;
        this.callFlash("SetButtonAction", [buttonAction])
    };
    SWFUpload.prototype.setButtonCursor = function(cursor) {
        this.settings.button_cursor = cursor;
        this.callFlash("SetButtonCursor", [cursor])
    };
    SWFUpload.prototype.queueEvent = function(handlerName, argumentArray) {
        if (argumentArray == undefined) {
            argumentArray = []
        } else {
            if (! (argumentArray instanceof Array)) {
                argumentArray = [argumentArray]
            }
        }
        var self = this;
        if (typeof this.settings[handlerName] === "function") {
            this.eventQueue.push(function() {
                this.settings[handlerName].apply(this, argumentArray)
            });
            setTimeout(function() {
                self.executeNextEvent()
            },
            0)
        } else {
            if (this.settings[handlerName] !== null) {
                throw "Event handler " + handlerName + " is unknown or is not a function"
            }
        }
    };
    SWFUpload.prototype.executeNextEvent = function() {
        var f = this.eventQueue ? this.eventQueue.shift() : null;
        if (typeof(f) === "function") {
            f.apply(this)
        }
    };
    SWFUpload.prototype.unescapeFilePostParams = function(file) {
        var reg = /[$]([0-9a-f]{4})/i;
        var unescapedPost = {};
        var uk;
        if (file != undefined) {
            for (var k in file.post) {
                if (file.post.hasOwnProperty(k)) {
                    uk = k;
                    var match;
                    while ((match = reg.exec(uk)) !== null) {
                        uk = uk.replace(match[0], String.fromCharCode(parseInt("0x" + match[1], 16)))
                    }
                    unescapedPost[uk] = file.post[k]
                }
            }
            file.post = unescapedPost
        }
        return file
    };
    SWFUpload.prototype.testExternalInterface = function() {
        try {
            return this.callFlash("TestExternalInterface")
        } catch(ex) {
            return false
        }
    };
    SWFUpload.prototype.flashReady = function() {
        var movieElement = this.getMovieElement();
        if (!movieElement) {
            return
        }
        this.cleanUp(movieElement);
        this.queueEvent("swfupload_loaded_handler")
    };
    SWFUpload.prototype.cleanUp = function(movieElement) {
        try {
            if (this.movieElement && typeof(movieElement.CallFunction) === "unknown") {
                for (var key in movieElement) {
                    try {
                        if (typeof(movieElement[key]) === "function") {
                            movieElement[key] = null
                        }
                    } catch(ex) {}
                }
            }
        } catch(ex1) {}
        window.__flash__removeCallback = function(instance, name) {
            try {
                if (instance) {
                    instance[name] = null
                }
            } catch(flashEx) {}
        }
    };
    SWFUpload.prototype.fileDialogStart = function() {
        this.queueEvent("file_dialog_start_handler")
    };
    SWFUpload.prototype.fileQueued = function(file) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("file_queued_handler", file)
    };
    SWFUpload.prototype.fileQueueError = function(file, errorCode, message) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("file_queue_error_handler", [file, errorCode, message])
    };
    SWFUpload.prototype.fileDialogComplete = function(numFilesSelected, numFilesQueued, numFilesInQueue) {
        this.queueEvent("file_dialog_complete_handler", [numFilesSelected, numFilesQueued, numFilesInQueue])
    };
    SWFUpload.prototype.uploadStart = function(file) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("return_upload_start_handler", file)
    };
    SWFUpload.prototype.returnUploadStart = function(file) {
        var returnValue;
        if (typeof this.settings.upload_start_handler === "function") {
            file = this.unescapeFilePostParams(file);
            returnValue = this.settings.upload_start_handler.call(this, file)
        } else {
            if (this.settings.upload_start_handler != undefined) {
                throw "upload_start_handler must be a function"
            }
        }
        if (returnValue === undefined) {
            returnValue = true
        }
        returnValue = !!returnValue;
        this.callFlash("ReturnUploadStart", [returnValue])
    };
    SWFUpload.prototype.uploadProgress = function(file, bytesComplete, bytesTotal) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("upload_progress_handler", [file, bytesComplete, bytesTotal])
    };
    SWFUpload.prototype.uploadError = function(file, errorCode, message) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("upload_error_handler", [file, errorCode, message])
    };
    SWFUpload.prototype.uploadSuccess = function(file, serverData, responseReceived) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("upload_success_handler", [file, serverData, responseReceived])
    };
    SWFUpload.prototype.uploadComplete = function(file) {
        file = this.unescapeFilePostParams(file);
        this.queueEvent("upload_complete_handler", file)
    };
    var swfobject = function() {
        var X = "undefined",
        P = "object",
        a = "visibility:visible",
        e = "visibility:hidden",
        B = "Shockwave Flash",
        h = "ShockwaveFlash.ShockwaveFlash",
        V = "application/x-shockwave-flash",
        K = "SWFObjectExprInst",
        G = window,
        g = document,
        N = navigator,
        f = [],
        H = [],
        Q = null,
        L = null,
        S = false,
        C = false;
        var Y = function() {
            var l = typeof g.getElementById != X && typeof g.getElementsByTagName != X && typeof g.createElement != X && typeof g.appendChild != X && typeof g.replaceChild != X && typeof g.removeChild != X && typeof g.cloneNode != X,
            t = [0, 0, 0],
            n = null;
            if (typeof N.plugins != X && typeof N.plugins[B] == P) {
                n = N.plugins[B].description;
                if (n) {
                    n = n.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
                    t[0] = parseInt(n.replace(/^(.*)\..*$/, "$1"), 10);
                    t[1] = parseInt(n.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
                    t[2] = /r/.test(n) ? parseInt(n.replace(/^.*r(.*)$/, "$1"), 10) : 0
                }
            } else {
                if (typeof G.ActiveXObject != X) {
                    var o = null,
                    s = false;
                    try {
                        o = new ActiveXObject(h + ".7")
                    } catch(k) {
                        try {
                            o = new ActiveXObject(h + ".6");
                            t = [6, 0, 21];
                            o.AllowScriptAccess = "always"
                        } catch(k) {
                            if (t[0] == 6) {
                                s = true
                            }
                        }
                        if (!s) {
                            try {
                                o = new ActiveXObject(h)
                            } catch(k) {}
                        }
                    }
                    if (!s && o) {
                        try {
                            n = o.GetVariable("$version");
                            if (n) {
                                n = n.split(" ")[1].split(",");
                                t = [parseInt(n[0], 10), parseInt(n[1], 10), parseInt(n[2], 10)]
                            }
                        } catch(k) {}
                    }
                }
            }
            var v = N.userAgent.toLowerCase(),
            j = N.platform.toLowerCase(),
            r = /webkit/.test(v) ? parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false,
            i = false,
            q = j ? /win/.test(j) : /win/.test(v),
            m = j ? /mac/.test(j) : /mac/.test(v);
            /*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/
            return {
                w3cdom: l,
                pv: t,
                webkit: r,
                ie: i,
                win: q,
                mac: m
            }
        } ();
        var d = function() {
            if (!Y.w3cdom) {
                return
            }
            J(I);
            if (Y.ie && Y.win) {
                try {
                    g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");
                    var i = b("__ie_ondomload");
                    if (i) {
                        i.onreadystatechange = function() {
                            if (this.readyState == "complete") {
                                this.parentNode.removeChild(this);
                                U()
                            }
                        }
                    }
                } catch(j) {}
            }
            if (Y.webkit && typeof g.readyState != X) {
                Q = setInterval(function() {
                    if (/loaded|complete/.test(g.readyState)) {
                        U()
                    }
                },
                10)
            }
            if (typeof g.addEventListener != X) {
                g.addEventListener("DOMContentLoaded", U, null)
            }
            M(U)
        } ();
        function U() {
            if (S) {
                return
            }
            if (Y.ie && Y.win) {
                var m = W("span");
                try {
                    var l = g.getElementsByTagName("body")[0].appendChild(m);
                    l.parentNode.removeChild(l)
                } catch(n) {
                    return
                }
            }
            S = true;
            if (Q) {
                clearInterval(Q);
                Q = null
            }
            var j = f.length;
            for (var k = 0; k < j; k++) {
                f[k]()
            }
        }
        function J(i) {
            if (S) {
                i()
            } else {
                f[f.length] = i
            }
        }
        function M(j) {
            if (typeof G.addEventListener != X) {
                G.addEventListener("load", j, false)
            } else {
                if (typeof g.addEventListener != X) {
                    g.addEventListener("load", j, false)
                } else {
                    if (typeof G.attachEvent != X) {
                        G.attachEvent("onload", j)
                    } else {
                        if (typeof G.onload == "function") {
                            var i = G.onload;
                            G.onload = function() {
                                i();
                                j()
                            }
                        } else {
                            G.onload = j
                        }
                    }
                }
            }
        }
        function I() {
            var l = H.length;
            for (var j = 0; j < l; j++) {
                var m = H[j].id;
                if (Y.pv[0] > 0) {
                    var k = b(m);
                    if (k) {
                        H[j].width = k.getAttribute("width") ? k.getAttribute("width") : "0";
                        H[j].height = k.getAttribute("height") ? k.getAttribute("height") : "0";
                        if (O(H[j].swfVersion)) {
                            if (Y.webkit && Y.webkit < 312) {
                                T(k)
                            }
                        } else {
                            if (H[j].expressInstall && !C && O("6.0.65") && (Y.win || Y.mac)) {
                                D(H[j])
                            } else {
                                c(k)
                            }
                        }
                    }
                }
                A("#" + m, a)
            }
        }
        function T(m) {
            var k = m.getElementsByTagName(P)[0];
            if (k) {
                var p = W("embed"),
                r = k.attributes;
                if (r) {
                    var o = r.length;
                    for (var n = 0; n < o; n++) {
                        if (r[n].nodeName.toLowerCase() == "data") {
                            p.setAttribute("src", r[n].nodeValue)
                        } else {
                            p.setAttribute(r[n].nodeName, r[n].nodeValue)
                        }
                    }
                }
                var q = k.childNodes;
                if (q) {
                    var s = q.length;
                    for (var l = 0; l < s; l++) {
                        if (q[l].nodeType == 1 && q[l].nodeName.toLowerCase() == "param") {
                            p.setAttribute(q[l].getAttribute("name"), q[l].getAttribute("value"))
                        }
                    }
                }
                m.parentNode.replaceChild(p, m)
            }
        }
        function F(i) {
            if (Y.ie && Y.win && O("8.0.0")) {
                G.attachEvent("onunload",
                function() {
                    var k = b(i);
                    for (var j in k) {
                        if (typeof k[j] == "function") {
                            k[j] = function() {}
                        }
                    }
                    k.parentNode.removeChild(k)
                })
            }
        }
        function D(j) {
            C = true;
            var o = b(j.id);
            if (o) {
                if (j.altContentId) {
                    var l = b(j.altContentId);
                    if (l) {
                        L = l
                    }
                } else {
                    L = Z(o)
                }
                if (! (/%$/.test(j.width)) && parseInt(j.width, 10) < 310) {
                    j.width = "310"
                }
                if (! (/%$/.test(j.height)) && parseInt(j.height, 10) < 137) {
                    j.height = "137"
                }
                g.title = g.title.slice(0, 47) + " - Flash Player Installation";
                var n = Y.ie && Y.win ? "ActiveX": "PlugIn",
                k = g.title,
                m = "MMredirectURL=" + G.location + "&MMplayerType=" + n + "&MMdoctitle=" + k,
                p = j.id;
                if (Y.ie && Y.win && o.readyState != 4) {
                    var i = W("div");
                    p += "SWFObjectNew";
                    i.setAttribute("id", p);
                    o.parentNode.insertBefore(i, o);
                    o.style.display = "none";
                    G.attachEvent("onload",
                    function() {
                        o.parentNode.removeChild(o)
                    })
                }
                R({
                    data: j.expressInstall,
                    id: K,
                    width: j.width,
                    height: j.height
                },
                {
                    flashvars: m
                },
                p)
            }
        }
        function c(j) {
            if (Y.ie && Y.win && j.readyState != 4) {
                var i = W("div");
                j.parentNode.insertBefore(i, j);
                i.parentNode.replaceChild(Z(j), i);
                j.style.display = "none";
                G.attachEvent("onload",
                function() {
                    j.parentNode.removeChild(j)
                })
            } else {
                j.parentNode.replaceChild(Z(j), j)
            }
        }
        function Z(n) {
            var m = W("div");
            if (Y.win && Y.ie) {
                m.innerHTML = n.innerHTML
            } else {
                var k = n.getElementsByTagName(P)[0];
                if (k) {
                    var o = k.childNodes;
                    if (o) {
                        var j = o.length;
                        for (var l = 0; l < j; l++) {
                            if (! (o[l].nodeType == 1 && o[l].nodeName.toLowerCase() == "param") && !(o[l].nodeType == 8)) {
                                m.appendChild(o[l].cloneNode(true))
                            }
                        }
                    }
                }
            }
            return m
        }
        function R(AE, AC, q) {
            var p, t = b(q);
            if (typeof AE.id == X) {
                AE.id = q
            }
            if (Y.ie && Y.win) {
                var AD = "";
                for (var z in AE) {
                    if (AE[z] != Object.prototype[z]) {
                        if (z == "data") {
                            AC.movie = AE[z]
                        } else {
                            if (z.toLowerCase() == "styleclass") {
                                AD += ' class="' + AE[z] + '"'
                            } else {
                                if (z != "classid") {
                                    AD += " " + z + '="' + AE[z] + '"'
                                }
                            }
                        }
                    }
                }
                var AB = "";
                for (var y in AC) {
                    if (AC[y] != Object.prototype[y]) {
                        AB += '<param name="' + y + '" value="' + AC[y] + '" />'
                    }
                }
                t.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + AD + ">" + AB + "</object>";
                F(AE.id);
                p = b(AE.id)
            } else {
                if (Y.webkit && Y.webkit < 312) {
                    var AA = W("embed");
                    AA.setAttribute("type", V);
                    for (var x in AE) {
                        if (AE[x] != Object.prototype[x]) {
                            if (x == "data") {
                                AA.setAttribute("src", AE[x])
                            } else {
                                if (x.toLowerCase() == "styleclass") {
                                    AA.setAttribute("class", AE[x])
                                } else {
                                    if (x != "classid") {
                                        AA.setAttribute(x, AE[x])
                                    }
                                }
                            }
                        }
                    }
                    for (var w in AC) {
                        if (AC[w] != Object.prototype[w]) {
                            if (w != "movie") {
                                AA.setAttribute(w, AC[w])
                            }
                        }
                    }
                    t.parentNode.replaceChild(AA, t);
                    p = AA
                } else {
                    var s = W(P);
                    s.setAttribute("type", V);
                    for (var v in AE) {
                        if (AE[v] != Object.prototype[v]) {
                            if (v.toLowerCase() == "styleclass") {
                                s.setAttribute("class", AE[v])
                            } else {
                                if (v != "classid") {
                                    s.setAttribute(v, AE[v])
                                }
                            }
                        }
                    }
                    for (var u in AC) {
                        if (AC[u] != Object.prototype[u] && u != "movie") {
                            E(s, u, AC[u])
                        }
                    }
                    t.parentNode.replaceChild(s, t);
                    p = s
                }
            }
            return p
        }
        function E(k, i, j) {
            var l = W("param");
            l.setAttribute("name", i);
            l.setAttribute("value", j);
            k.appendChild(l)
        }
        function b(i) {
            return g.getElementById(i)
        }
        function W(i) {
            return g.createElement(i)
        }
        function O(k) {
            var j = Y.pv,
            i = k.split(".");
            i[0] = parseInt(i[0], 10);
            i[1] = parseInt(i[1], 10);
            i[2] = parseInt(i[2], 10);
            return (j[0] > i[0] || (j[0] == i[0] && j[1] > i[1]) || (j[0] == i[0] && j[1] == i[1] && j[2] >= i[2])) ? true: false
        }
        function A(m, j) {
            if (Y.ie && Y.mac) {
                return
            }
            var l = g.getElementsByTagName("head")[0],
            k = W("style");
            k.setAttribute("type", "text/css");
            k.setAttribute("media", "screen");
            if (! (Y.ie && Y.win) && typeof g.createTextNode != X) {
                k.appendChild(g.createTextNode(m + " {" + j + "}"))
            }
            l.appendChild(k);
            if (Y.ie && Y.win && typeof g.styleSheets != X && g.styleSheets.length > 0) {
                var i = g.styleSheets[g.styleSheets.length - 1];
                if (typeof i.addRule == P) {
                    i.addRule(m, j)
                }
            }
        }
        return {
            registerObject: function(l, i, k) {
                if (!Y.w3cdom || !l || !i) {
                    return
                }
                var j = {};
                j.id = l;
                j.swfVersion = i;
                j.expressInstall = k ? k: false;
                H[H.length] = j;
                A("#" + l, e)
            },
            getObjectById: function(l) {
                var i = null;
                if (Y.w3cdom && S) {
                    var j = b(l);
                    if (j) {
                        var k = j.getElementsByTagName(P)[0];
                        if (!k || (k && typeof j.SetVariable != X)) {
                            i = j
                        } else {
                            if (typeof k.SetVariable != X) {
                                i = k
                            }
                        }
                    }
                }
                return i
            },
            embedSWF: function(n, u, r, t, j, m, k, p, s) {
                if (!Y.w3cdom || !n || !u || !r || !t || !j) {
                    return
                }
                r += "";
                t += "";
                if (O(j)) {
                    A("#" + u, e);
                    var q = (typeof s == P) ? s: {};
                    q.data = n;
                    q.width = r;
                    q.height = t;
                    var o = (typeof p == P) ? p: {};
                    if (typeof k == P) {
                        for (var l in k) {
                            if (k[l] != Object.prototype[l]) {
                                if (typeof o.flashvars != X) {
                                    o.flashvars += "&" + l + "=" + k[l]
                                } else {
                                    o.flashvars = l + "=" + k[l]
                                }
                            }
                        }
                    }
                    J(function() {
                        R(q, o, u);
                        A("#" + u, a)
                    })
                } else {
                    if (m && !C && O("6.0.65") && (Y.win || Y.mac)) {
                        A("#" + u, e);
                        J(function() {
                            var i = {};
                            i.id = i.altContentId = u;
                            i.width = r;
                            i.height = t;
                            i.expressInstall = m;
                            D(i);
                            A("#" + u, a)
                        })
                    }
                }
            },
            getFlashPlayerVersion: function() {
                return {
                    major: Y.pv[0],
                    minor: Y.pv[1],
                    release: Y.pv[2]
                }
            },
            hasFlashPlayerVersion: O,
            createSWF: function(k, j, i) {
                if (Y.w3cdom && S) {
                    return R(k, j, i)
                } else {
                    return undefined
                }
            },
            createCSS: function(j, i) {
                if (Y.w3cdom) {
                    A(j, i)
                }
            },
            addDomLoadEvent: J,
            addLoadEvent: M,
            getQueryParamValue: function(m) {
                var l = g.location.search || g.location.hash;
                if (m == null) {
                    return l
                }
                if (l) {
                    var k = l.substring(1).split("&");
                    for (var j = 0; j < k.length; j++) {
                        if (k[j].substring(0, k[j].indexOf("=")) == m) {
                            return k[j].substring((k[j].indexOf("=") + 1))
                        }
                    }
                }
                return ""
            },
            expressInstallCallback: function() {
                if (C && L) {
                    var i = b(K);
                    if (i) {
                        i.parentNode.replaceChild(L, i);
                        L = null;
                        C = false
                    }
                }
            }
        }
    } ();
    var SWFUpload;
    if (typeof(SWFUpload) === "function") {
        SWFUpload.onload = function() {};
        swfobject.addDomLoadEvent(function() {
            if (typeof(SWFUpload.onload) === "function") {
                SWFUpload.onload.call(window)
            }
        });
        SWFUpload.prototype.initSettings = (function(oldInitSettings) {
            return function() {
                if (typeof(oldInitSettings) === "function") {
                    oldInitSettings.call(this)
                }
                this.ensureDefault = function(settingName, defaultValue) {
                    this.settings[settingName] = (this.settings[settingName] == undefined) ? defaultValue: this.settings[settingName]
                };
                this.ensureDefault("minimum_flash_version", "9.0.28");
                this.ensureDefault("swfupload_load_failed_handler", null);
                delete this.ensureDefault
            }
        })(SWFUpload.prototype.initSettings);
        SWFUpload.prototype.loadFlash = function(oldLoadFlash) {
            return function() {
                var hasFlash = swfobject.hasFlashPlayerVersion(this.settings.minimum_flash_version);
                if (hasFlash) {
                    this.queueEvent("swfupload_pre_load_handler");
                    if (typeof(oldLoadFlash) === "function") {
                        oldLoadFlash.call(this)
                    }
                } else {
                    this.queueEvent("swfupload_load_failed_handler")
                }
            }
        } (SWFUpload.prototype.loadFlash)
    }
    var SWFUpload;
    if (typeof(SWFUpload) === "function") {
        SWFUpload.queue = {};
        SWFUpload.prototype.initSettings = (function(oldInitSettings) {
            return function() {
                if (typeof(oldInitSettings) === "function") {
                    oldInitSettings.call(this)
                }
                this.queueSettings = {};
                this.queueSettings.queue_cancelled_flag = false;
                this.queueSettings.queue_upload_count = 0;
                this.queueSettings.user_upload_complete_handler = this.settings.upload_complete_handler;
                this.queueSettings.user_upload_start_handler = this.settings.upload_start_handler;
                this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
                this.settings.upload_start_handler = SWFUpload.queue.uploadStartHandler;
                this.settings.queue_complete_handler = this.settings.queue_complete_handler || null
            }
        })(SWFUpload.prototype.initSettings);
        SWFUpload.prototype.startUpload = function(fileID) {
            this.queueSettings.queue_cancelled_flag = false;
            this.callFlash("StartUpload", [fileID])
        };
        SWFUpload.prototype.cancelQueue = function() {
            this.queueSettings.queue_cancelled_flag = true;
            this.stopUpload();
            var stats = this.getStats();
            while (stats.files_queued > 0) {
                this.cancelUpload();
                stats = this.getStats()
            }
        };
        SWFUpload.queue.uploadStartHandler = function(file) {
            var returnValue;
            if (typeof(this.queueSettings.user_upload_start_handler) === "function") {
                returnValue = this.queueSettings.user_upload_start_handler.call(this, file)
            }
            returnValue = (returnValue === false) ? false: true;
            this.queueSettings.queue_cancelled_flag = !returnValue;
            return returnValue
        };
        SWFUpload.queue.uploadCompleteHandler = function(file) {
            var user_upload_complete_handler = this.queueSettings.user_upload_complete_handler;
            var continueUpload;
            if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
                this.queueSettings.queue_upload_count++
            }
            if (typeof(user_upload_complete_handler) === "function") {
                continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false: true
            } else {
                if (file.filestatus === SWFUpload.FILE_STATUS.QUEUED) {
                    continueUpload = false
                } else {
                    continueUpload = true
                }
            }
            if (continueUpload) {
                var stats = this.getStats();
                if (stats.files_queued > 0 && this.queueSettings.queue_cancelled_flag === false) {
                    this.startUpload()
                } else {
                    if (this.queueSettings.queue_cancelled_flag === false) {
                        this.queueEvent("queue_complete_handler", [this.queueSettings.queue_upload_count]);
                        this.queueSettings.queue_upload_count = 0
                    } else {
                        this.queueSettings.queue_cancelled_flag = false;
                        this.queueSettings.queue_upload_count = 0
                    }
                }
            }
        }
    }
    function FileProgress(file, swfupload) {
        this.swfupload = swfupload;
        this.getIconName = function(type) {
            var fileTypes = {
                icon_file_image: "jpg,jpeg,gif,bmp,png,jpe,cur,svg,svgz,tif,tiff,ico",
                icon_file_visio: "vsd,vsdx",
                icon_file_pdf: "pdf",
                icon_file_word: "doc,docx,ods,ots,odt,rtf,dot,dotx,odm",
                icon_file_excel: "xls,xlsx,xlt,xltx,csv",
                icon_file_text: "txt,html,htm,xhtml,xml,js,css",
                icon_file_music: "wma,wav,mp3,aac,ra,ram,mp2,ogg,aif,mpega,amr,mid,midi",
                icon_file_video: "wmv,rmvb,mpeg4,mpeg2,flv,avi,3gp,mpga,qt,rm,wmz,wmd,wvx,wmx,wm,swf,mpg,mp4,mkv,mpeg,mov",
                icon_file_powerpoint: "ppt,pptx,pps,pot,ppsx,potx",
                icon_file_ipa: "ipa",
                icon_file_exe: "exe,msi",
                icon_file_zip: "zip,rar,7z,tar,gz",
                icon_file_apk: "apk",
                icon_file_default: "default",
                icon_file_torrent: "torrent"
            },
            iconNames = {};
            for (i in fileTypes) {
                var suffix = fileTypes[i].split(",");
                for (j in suffix) {
                    iconNames.hasOwnProperty(suffix[j]);
                    if (iconNames[suffix[j]] == undefined) {
                        iconNames[suffix[j]] = i
                    }
                }
            }
            return iconNames[type.toLowerCase()] ? iconNames[type.toLowerCase()] : iconNames["default"]
        };
        this.getShortName = function(filename, limit) {
            if (!limit) {
                limit = 27
            }
            for (var i = 0,
            len = 0; i < filename.length; i++) {
                if (filename.charAt(i).match(/[^\x00-\xff]/g) != null) {
                    len += 2
                } else {
                    len++
                }
                if (len > limit) {
                    break
                }
            }
            return filename.substr(0, i) + (i >= filename.length ? "": "...")
        };
        this.getFileSize = function(filesize) {
            var units = ["B", "K", "M", "G", "T"];
            var p = Math.min(Math.max(Math.floor(Math.log(filesize) / Math.LN2 / 10), 1), 5);
            return Math.round(filesize * 100 / Math.pow(2, p * 10)) / 100 + units[p]
        };
        this.fileProgressWrapper = document.getElementById(swfupload.customSettings.progressTarget).firstChild;
        this.fileIcon = T(".fileIcon", this.fileProgressWrapper)[0];
        this.progressName = T(".progressName", this.fileProgressWrapper)[0];
        this.progressSize = T(".progressSize", this.fileProgressWrapper)[0];
        this.progressRename = T(".progressRename", this.fileProgressWrapper)[0];
        this.progressRenameValue = T(".progressRenameValue", this.fileProgressWrapper)[0];
        this.progressMessage = T(".progressMessage", this.fileProgressWrapper)[0];
        this.progressBarWrapper = T(".progressBarWrapper", this.fileProgressWrapper)[0];
        this.progressBar = T(".progressBar", this.fileProgressWrapper)[0];
        this.progressBarText = T(".progressBarText", this.fileProgressWrapper)[0];
        this.progressCancel = T(".progressCancel", this.fileProgressWrapper)[0];
        this.progressWealthWrapper = T(".progressWealthWrapper", this.fileOperator)[0];
        this.fileOperator = T(".progressFileOperator", this.fileProgressWrapper)[0];
        this.fileOperatorRename = T("a.rename", this.fileOperator)[0];
        this.fileOperatorDelete = T("a.remove", this.fileOperator)[0];
        this.setFileInfo(file.name, file.size)
    }
    FileProgress.prototype.setFileInfo = function(filename, filesize, hideNewName) {
        var tmpArr;
        if (!hideNewName) {
            this.progressName.innerHTML = this.getShortName(filename, 27);
            this.progressName.setAttribute("title", filename)
        }
        if (this.swfupload.customSettings.currentFile) {
            this.swfupload.customSettings.currentFile.name = filename
        }
        if (filesize != null) {
            this.progressSize.innerHTML = "(" + this.getFileSize(filesize) + ")"
        }
        tmpArr = filename.match(/\.([^\.]+)$/);
        if (tmpArr != null) {
            this.fileIcon.className = "fileIcon " + this.getIconName(tmpArr[1])
        } else {
            this.fileIcon.className = "fileIcon " + this.getIconName("")
        }
    };
    FileProgress.prototype.setStatus = function(status, message, errorCode, percentage) {
        var displayCode = "",
        displayArr, swfupload = this.swfupload;
        this.progressMessage.innerHTML = message || "";
        switch (status) {
            case "ready":
                swfupload.customSettings.setBindUploadStatus("ready");
                displayCode = "1,1,1,0,0,0,0,1,1,1";
                break;
            case "uploading":
                if (percentage != undefined) {
                    this.progressMessage.innerHTML = percentage;
                    this.progressBar.style.width = percentage + "%";
                    this.progressBarText.innerHTML = (percentage >= 100 ? 99 : percentage) + "%"
                }
                this.progressBar.className = "progressBar";
                this.fileProgressWrapper.className = "progressWrapper";
                swfupload.customSettings.setBindUploadStatus("uploading");
                displayCode = "1,1,1,0,0,1,1,0,0,0";
                break;
            case "finish":
                this.progressBar.style.width = "99%";
                this.progressBarText.innerHTML = "99%";
                swfupload.customSettings.setBindUploadStatus("finish");
                displayCode = "1,1,1,0,0,1,1,0,0,0";
                break;
            case "complete":
                this.progressBar.style.width = "";
                this.progressBarText.innerHTML = "100%";
                this.progressBar.className = "progressBar progressBarComplete";
                swfupload.customSettings.setBindUploadStatus("complete");
                displayCode = "1,1,1,0,0,1,0,1,1,1";
                swfupload.customSettings.setEditorStatusBar("");
                break;
            case "error":
                this.progressBar.style.width = "";
                this.fileProgressWrapper.className = "progressWrapper progressWrapperError";
                if (errorCode != undefined) {
                    swfupload.customSettings.setBindUploadStatus("error", errorCode)
                } else {
                    swfupload.customSettings.setBindUploadStatus("error", -1)
                }
                displayCode = "1,1,1,0,1,0,0,0,0,1";
                break;
            case "setfilesuccess":
                this.progressBar.style.width = "";
                this.progressBarText.innerHTML = "100%";
                this.progressBar.className = "progressBar";
                swfupload.customSettings.setBindUploadStatus("complete");
                displayCode = "1,1,1,0,0,1,0,1,1,1";
                break;
            case "setfileerror":
                this.fileProgressWrapper.className = "progressWrapper progressWrapperError";
                this.progressMessage.innerHTML = message;
                swfupload.customSettings.setBindUploadStatus("error", -1);
                displayCode = "0,0,0,0,1,0,0,0,0,1";
                break;
            case "renamestart":
                displayCode = "1,0,0,1,0,0,0,0,0,0";
                break;
            case "renamecomplete":
                swfupload.customSettings.setBindUploadStatus("complete");
                displayCode = "1,1,1,0,0,1,0,1,1,1";
                break;
            case "renameerror":
                this.fileProgressWrapper.className = "progressWrapper progressWrapperError";
                swfupload.customSettings.setBindUploadStatus("error", -1);
                displayCode = "1,0,0,1,1,0,0,0,0,0";
                break;
            default:
                displayCode = "1,1,1,0,0,0,0,0,0,0";
                break
        }
        displayArr = displayCode.split(",");
        if (swfupload.customSettings.isEditorFile) {
            displayArr[5] = 0
        }
        this.fileIcon.style.display = displayArr[0] == "1" ? "block": "none";
        this.progressName.style.display = displayArr[1] == "1" ? "block": "none";
        this.progressSize.style.display = displayArr[2] == "1" ? "block": "none";
        this.progressRename.style.display = displayArr[3] == "1" ? "block": "none";
        this.progressMessage.style.display = displayArr[4] == "1" ? "block": "none";
        this.progressBarWrapper.style.display = displayArr[5] == "1" ? "block": "none";
        this.progressCancel.style.display = displayArr[6] == "1" ? "block": "none";
        this.progressWealthWrapper.style.display = displayArr[7] == "1" ? "block": "none";
        this.fileOperatorRename.style.display = displayArr[8] == "1" ? "inline": "none";
        this.fileOperatorDelete.style.display = displayArr[9] == "1" ? "inline": "none";
        this.fileProgressWrapper.style.display = "block"
    };
    window.swfUploadPreLoad = function() {};
    window.swfUploadLoaded = function() {
        try {
            SWFUpload.SERVER_ERROR = {
                "31042": "\u60a8\u5c1a\u672a\u767b\u5f55",
                "31061": "\u5df2\u5b58\u5728\u540c\u540d\u6587\u4ef6",
                "31062": "\u6587\u4ef6\u540d\u79f0\u975e\u6cd5",
                "31073": "\u91cd\u547d\u540d\u5931\u8d25",
                "31218": "\u5bb9\u91cf\u8d85\u51fa\u9650\u989d"
            };
            var swfupload = this;
            swfupload.customSettings.cancelHandler = function(e) {
                var progress = swfupload.progress;
                e.preventDefault();
                swfupload.cancelUpload(swfupload.customSettings.currentFile.id);
                swfupload.customSettings.successCount = 0;
                swfupload.customSettings.isUploading = false;
                progress.setStatus("ready");
                T(progress.fileProgressWrapper).hide()
            };
            swfupload.customSettings.deleteHandler = function(e) {
                var progress = swfupload.progress,
                fileinfo = swfupload.customSettings.getUploadFile();
                e.preventDefault();
                swfupload.customSettings.successCount = 0;
                swfupload.customSettings.setUploadFile("fileInfo", null);
                progress.setStatus("ready");
                T(progress.fileProgressWrapper).hide();
                if (swfupload.customSettings.isEditorFile) {
                    swfupload.customSettings.setUploadFile("backFileInfo", true, "delete")
                } else {
                    var swfUploadDir = swfupload.customSettings.swfUploadDir;
                    if (fileinfo && fileinfo.path.substr(0, swfUploadDir.length) == swfUploadDir && !swfupload.customSettings.isInsertFromWangPan) {
                        T.ajax({
                            url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=delete&app_id=598913&response-status=200&op=permanent&fs_id=" + fileinfo.fs_id),
                            dataType: "jsonp",
                            success: function(response) {}
                        })
                    }
                }
                swfupload.customSettings.setEditorStatusBar("")
            };
            swfupload.customSettings.inputHandler = function(e) {
                if (e.keyCode == 13) {
                    swfupload.customSettings.doRenameHandler()
                }
            };
            swfupload.customSettings.renameHandler = function(e) {
                var progress = swfupload.progress;
                e.preventDefault();
                progress.setStatus("renamestart");
                progress.progressRenameValue.value = progress.progressName.title; (function setSelectionRange(t, S, E) {
                    if (t.createTextRange) {
                        var range = t.createTextRange();
                        range.collapse(true);
                        range.moveStart("character", S);
                        range.moveEnd("character", E);
                        range.select()
                    } else {
                        if (t.setSelectionRange) {
                            t.setSelectionRange(S, E)
                        } else {
                            if (t.selectionStart) {
                                t.selectionStart = S;
                                t.selectionEnd = E
                            }
                        }
                    }
                })(progress.progressRenameValue, 0, progress.progressRenameValue.value.lastIndexOf("."));
                progress.progressRenameValue.focus()
            };
            swfupload.customSettings.doRenameHandler = function() {
                var progress = swfupload.progress,
                newname = T.string(progress.progressRenameValue.value).trim();
                if (/\.((jpg)|(jpeg)|(gif)|(bmp)|(png)|(jpe)|(cur)|(tif)|(tiff)|(ico))$/i.test(newname)) {
                    progress.setStatus("renameerror", "\u4e0d\u5141\u8bb8\u6539\u6210\u56fe\u7247\u683c\u5f0f")
                } else {
                    if (/[\\\/:\*\?"<>|]/.test(newname)) {
                        progress.setStatus("renameerror", '\u6587\u4ef6\u540d\u4e0d\u80fd\u5305\u542b\u4e0b\u5217\u5b57\u7b26 \\ / : * ? " < > |')
                    } else {
                        var showName = progress.progressName.title,
                        pathfrom = swfupload.customSettings.getUploadFile().path,
                        pathto = pathfrom.substr(0, pathfrom.lastIndexOf("/") + 1) + newname;
                        if (pathfrom != pathto && swfupload.customSettings.isEditorFile) {
                            swfupload.customSettings.setUploadFile("backFileInfo", pathto, "rename");
                            progress.setFileInfo(newname);
                            progress.setStatus("renamecomplete")
                        } else {
                            if (newname != "" && newname != showName.substr(showName.lastIndexOf(".") + 1) && newname != showName && pathto != pathfrom) {
                                T.ajax({
                                    url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=move&app_id=598913&response-status=200&from=" + pathfrom + "&to=" + pathto),
                                    dataType: "jsonp",
                                    success: function(response) {
                                        if (response.error_code) {
                                            if (response.error_code == 31218 || response.error_code == 31112) {
                                                progress.setStatus("renameerror", '<span>\u7f51\u76d8\u5df2\u6ee1</span><a href="http://yun.baidu.com/disk/award" class="progressExtend" target="_blank">\u6269\u5bb9</a>')
                                            } else {
                                                progress.setStatus("renameerror", SWFUpload.SERVER_ERROR[response.error_code])
                                            }
                                        } else {
                                            progress.setStatus("renamecomplete");
                                            progress.setFileInfo(newname);
                                            swfupload.progress.setFileInfo(newname);
                                            swfupload.customSettings.setUploadFile("fileInfo", pathto, "path")
                                        }
                                    }
                                })
                            } else {
                                progress.setStatus("complete")
                            }
                        }
                    }
                }
            };
            var fileProgressWrapper = document.getElementById(swfupload.customSettings.progressTarget).firstChild;
            var progressCancel = T(".progressCancel", fileProgressWrapper)[0];
            var progressRenameValue = T(".progressRenameValue", fileProgressWrapper)[0];
            var progressRenameButton = T(".progressRenameBtn", fileProgressWrapper)[0];
            var fileOperatorRename = T(".progressFileOperator a", fileProgressWrapper)[0];
            var fileOperatorDelete = T(".progressFileOperator a", fileProgressWrapper)[1];
            T.on(progressCancel, "click", swfupload.customSettings.cancelHandler);
            T.on(fileOperatorRename, "click", swfupload.customSettings.renameHandler);
            T.on(progressRenameValue, "keyup", swfupload.customSettings.inputHandler);
            T.on(progressRenameButton, "click", swfupload.customSettings.doRenameHandler);
            T.on(fileOperatorDelete, "click", swfupload.customSettings.deleteHandler);
            if (swfupload.customSettings.isEditorFile) {
                if (swfupload.customSettings.getUploadFile()) {
                    swfupload.customSettings.setBindUploadStatus("complete")
                } else {
                    swfupload.customSettings.setBindUploadStatus("error", -1)
                }
            } else {
                swfupload.customSettings.setBindUploadStatus("ready")
            }
        } catch(ex) {}
    };
    window.swfUploadLoadFailed = function() {};
    window.swfUploadFileDialogStart = function() {};
    window.swfUploadFileDialogComplete = function(numFilesSelected, numFilesQueued) {
        var swfupload = this;
        swfupload.customSettings.hideAllPopup()
    };
    window.swfUploadFileQueued = function(file) {
        try {
            var swfupload = this;
            if (/\.((jpg)|(jpeg)|(gif)|(bmp)|(png)|(jpe)|(cur)|(tif)|(tiff)|(ico))$/i.test(file.type)) {
                Dialog.alert("\u8bf7\u4f7f\u7528\u63d2\u5165\u56fe\u7247\u529f\u80fd\uff0c\u53ef\u76f4\u63a5\u5728\u7ebf\u9884\u89c8")
            } else {
                if (swfupload.customSettings.successCount > 0 || swfupload.customSettings.isUploading == true) {
                    var coverConfirm = new Dialog({
                        type: "confirm",
                        width: 400,
                        height: 150,
                        titleText: "\u77e5\u9053\u63d0\u793a",
                        content: '<div class="f-14"><img class="grid" src="http://img.baidu.com/img/iknow/feedback/icon-question.png"><p>\u60a8\u53ea\u80fd\u4e0a\u4f20\u4e00\u4e2a\u9644\u4ef6\uff0c\u4e0a\u4e00\u9644\u4ef6\u5c06\u88ab\u8986\u76d6\uff0c\u786e\u5b9a\u5417\uff1f</p><p class="f-12 f-gray pl-20">\uff08\u5982\u679c\u60f3\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6\uff0c\u8bf7\u6253\u5305\uff09</p></div>',
                        onaccept: function() {
                            try {
                                coverConfirm.hide();
                                var fileinfo = swfupload.customSettings.getUploadFile();
                                swfupload.progress = new FileProgress(file, swfupload);
                                swfupload.customSettings.setUploadFile("fileInfo", null);
                                swfupload.customSettings.successCount = 0;
                                if (swfupload.customSettings.isEditorFile) {
                                    swfupload.customSettings.setUploadFile("backFileInfo", true, "delete")
                                } else {
                                    var swfUploadDir = swfupload.customSettings.swfUploadDir;
                                    if (fileinfo && fileinfo.path.substr(0, swfUploadDir.length) == swfUploadDir && !swfupload.customSettings.isInsertFromWangPan) {
                                        T.ajax({
                                            url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=delete&app_id=598913&response-status=200&op=permanent&fs_id=" + fileinfo.fs_id),
                                            dataType: "jsonp",
                                            success: function(response) {}
                                        })
                                    }
                                }
                                swfupload.cancelUpload(swfupload.customSettings.currentFile.id, false);
                                swfupload.startUpload()
                            } catch(ex) {}
                        },
                        oncancel: function() {
                            try {
                                coverConfirm.hide();
                                swfupload.cancelUpload(file.id, false)
                            } catch(ex) {}
                        }
                    })
                } else {
                    swfupload.progress = new FileProgress(file, swfupload);
                    swfupload.startUpload()
                }
            }
        } catch(ex) {}
    };
    window.swfUploadQueueComplete = function(numFilesUploaded) {};
    window.swfUploadFileQueueError = function(file, errorCode, message) {
        try {
            var swfupload = this,
            progress;
            if (swfupload.progress) {
                progress = swfupload.progress
            } else {
                progress = swfupload.progress = new FileProgress(file, swfupload)
            }
            swfupload.customSettings.setBindUploadStatus("error", -1);
            swfupload.customSettings.isUploading = false;
            switch (errorCode) {
                case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
                case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
                    progress.setStatus("error", "\u6587\u4ef6\u8d85\u8fc72G\u6216\u4e3a\u7a7a");
                    break;
                case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
                    progress.setStatus("error", "\u4e0a\u4f20\u6587\u4ef6\u7c7b\u578b\u4e0d\u5141\u8bb8");
                    break;
                default:
                    if (file !== null) {
                        progress.setStatus("error", "\u4e0a\u4f20\u5931\u8d25\u8bf7\u91cd\u8bd5\u6216\u5220\u9664")
                    }
                    break
            }
        } catch(ex) {}
    };
    window.swfUploadSendStart = function(file) {
        try {
            var swfupload = this,
            bduss = F.context("user")["BDUSS"] || null,
            progress = swfupload.progress;
            swfupload.customSettings.isUploading = false;
            swfupload.customSettings.isEditorFile = false;
            swfupload.customSettings.isInsertFromWangPan = false;
            swfupload.customSettings.currentFile = file;
            if (!bduss) {
                progress.setStatus("error", "\u60a8\u5c1a\u672a\u767b\u5f55");
                swfupload.cancelUpload(file.id, false)
            } else {
                progress.setStatus("uploading", "", null, 0);
                swfupload.setUploadURL(encodeURI(swfupload.customSettings.swfUploadUrl + "&path=" + swfupload.customSettings.swfUploadDir + file.name + "&BDUSS=" + bduss))
            }
        } catch(ex) {}
        return true
    };
    window.swfUploadSendProgress = function(file, bytesLoaded, bytesTotal) {
        try {
            var swfupload = this,
            progress = swfupload.progress,
            percentage = Math.ceil((bytesLoaded / bytesTotal) * 100);
            swfupload.customSettings.isUploading = true;
            if (percentage != 100) {
                progress.setStatus("uploading", "", null, percentage)
            } else {
                progress.setStatus("finish")
            }
        } catch(ex) {}
    };
    window.swfUploadSendSuccess = function(file, serverData) {
        try {
            var swfupload = this,
            progress = swfupload.progress,
            error_message, fileinfo = eval("(" + serverData + ")");
            swfupload.customSettings.isUploading = false;
            if (fileinfo.error_code == 31218 || fileinfo.error_code == 31112) {
                progress.setStatus("error", '<span>\u7f51\u76d8\u5df2\u6ee1</span><a href="http://yun.baidu.com/disk/award" class="progressExtend" target="_blank">\u6269\u5bb9</a>', fileinfo.error_code)
            } else {
                if (fileinfo.error_code) {
                    error_message = SWFUpload.SERVER_ERROR[fileinfo.error_code];
                    if (!error_message) {
                        error_message = "\u4e0a\u4f20\u5931\u8d25"
                    }
                    progress.setStatus("error", error_message + ",\u8bf7\u91cd\u8bd5\u6216\u8005\u5220\u9664", fileinfo.error_code)
                } else {
                    var serverFileName = fileinfo.path.substr(fileinfo.path.lastIndexOf("/") + 1);
                    if (serverFileName != swfupload.customSettings.currentFile.name) {
                        progress.setFileInfo(serverFileName, null, true)
                    }
                    progress.setStatus("complete");
                    swfupload.customSettings.successCount++;
                    swfupload.customSettings.setUploadFile("fileInfo", fileinfo)
                }
            }
        } catch(ex) {
            var swfupload = this,
            progress = swfupload.progress;
            if (ex.name == "SyntaxError") {
                progress.setStatus("error", "\u4e0a\u4f20\u5931\u8d25\u8bf7\u91cd\u8bd5\u6216\u5220\u9664")
            }
        }
    };
    window.swfUploadSendError = function(file, errorCode, message) {
        try {
            var swfupload = this,
            progress = swfupload.progress;
            if (errorCode != SWFUpload.UPLOAD_ERROR.FILE_CANCELLED) {
                swfupload.customSettings.setBindUploadStatus("error", -1);
                progress.setStatus("error", "\u4e0a\u4f20\u5931\u8d25\u8bf7\u91cd\u8bd5\u6216\u5220\u9664")
            }
        } catch(ex) {}
    };
    window.swfUploadSendComplete = function() {};
    window.editorSetUploadFile = function(data, isInsertFromWangPan, editor) {
        var swfupload = editor.swfupload;
        if (swfupload && swfupload.customSettings.successCount > 0) {}
        if (data && !data.error) {
            var fileinfo = data.fileInfo;
            fileinfo.path = decodeURIComponent(fileinfo.path);
            var filename = fileinfo.path.substr(fileinfo.path.lastIndexOf("/") + 1),
            filesize = fileinfo.size,
            tmpArr = fileinfo.path.match(/(\.[^\.]*)$/),
            filetype = tmpArr ? tmpArr[1] : ".";
            editor._uploadFile.fileInfo = fileinfo;
            editor._uploadFile.backFileInfo = fileinfo;
            swfupload.customSettings.isEditorFile = true;
            swfupload.customSettings.isInsertFromWangPan = isInsertFromWangPan;
            swfupload.customSettings.successCount = 1;
            swfupload.customSettings.currentFile = {
                id: "SWFUpload_0_EDIT",
                name: filename || "",
                size: filesize || 0,
                type: filetype || "",
                filestatus: -4,
                index: 1
            };
            swfupload.progress = new FileProgress(swfupload.customSettings.currentFile, swfupload);
            swfupload.progress.setStatus("setfilesuccess");
            swfupload.progress.setFileInfo(filename, filesize)
        } else {
            editor._uploadFile.fileInfo = null;
            editor._uploadFile.backFileInfo = null;
            swfupload.customSettings.isEditorFile = true;
            swfupload.customSettings.successCount = 0;
            swfupload.customSettings.currentFile = {
                id: "SWFUpload_0_NULL",
                name: "",
                size: 0,
                type: "",
                filestatus: -4,
                index: 1,
                creationdate: 0,
                modificationdate: 0
            };
            swfupload.progress = new FileProgress(swfupload.customSettings.currentFile, swfupload);
            swfupload.progress.setStatus("setfileerror", '<span style="padding-left:5px;">\u5f88\u62b1\u6b49\uff0c\u60a8\u4e0a\u4f20\u7684\u9644\u4ef6\u5df2\u5931\u6548\uff0c\u8bf7\u91cd\u65b0\u4e0a\u4f20\u6216\u5220\u9664\u3002</span>');
            swfupload.progress.setFileInfo("", 0)
        }
    };
    window.editorSubmitUploadFile = function(method, editor) {
        var fileInfo = editor._uploadFile.fileInfo,
        backFileInfo = editor._uploadFile.backFileInfo,
        swfupload = editor.swfupload,
        swfUploadDir = swfupload.customSettings.swfUploadDir;
        switch (method) {
            case "submit":
                if (backFileInfo && backFileInfo["delete"]) {
                    if (backFileInfo.path.substr(0, swfUploadDir.length) == swfUploadDir && !swfupload.customSettings.isInsertFromWangPan) {
                        T.ajax({
                            url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=delete&app_id=598913&response-status=200&op=permanent&fs_id=" + backFileInfo.fs_id),
                            dataType: "jsonp",
                            success: function(response) {}
                        })
                    }
                } else {
                    if (backFileInfo && backFileInfo.rename && backFileInfo.path != backFileInfo.rename) {
                        T.ajax({
                            url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=move&app_id=598913&response-status=200&from=" + backFileInfo.path + "&to=" + backFileInfo.rename),
                            dataType: "jsonp",
                            success: function(response) {}
                        })
                    }
                }
                break;
            case "cancel":
                if ((fileInfo && !backFileInfo) || (fileInfo && backFileInfo && fileInfo.fs_id != backFileInfo.fs_id)) {
                    if (fileInfo.path.substr(0, swfUploadDir.length) == swfUploadDir && !swfupload.customSettings.isInsertFromWangPan) {
                        T.ajax({
                            url: encodeURI("https://pcs.baidu.com/rest/2.0/pcs/file?method=delete&app_id=598913&response-status=200&op=permanent&fs_id=" + fileInfo.fs_id),
                            dataType: "jsonp",
                            success: function(response) {}
                        })
                    }
                }
                editor._uploadFile.fileInfo = backFileInfo;
                break
        }
    };
    window.SWFUpload = SWFUpload;
    return exports
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/dialog/dialog.js", "/static/common/ui/util/util.js"]);
F.module("/static/common/ui/editor/editor.js",
function(b, a) { (function() {
    UEDITOR_CONFIG = window.UEDITOR_CONFIG || {};
    var s = window.baidu || {};
    window.baidu = s;
    window.UE = s.editor = {};
    UE.plugins = {};
    UE.commands = {};
    UE.instants = {};
    UE.I18N = {};
    UE.version = "1.2.6.0";
    var y = UE.dom = {};
    var g = b("/static/common/lib/tangram/base/base.js");
    var B = b("/static/common/ui/store/store.js");
    var G = b("/static/common/ui/editor/config/config.js");
    var m = b("/static/common/ui/editor/lang/lang.js");
    var k = b("/static/common/ui/dialog/dialog.js");
    var l = b("/static/common/ui/event/event.js");
    var A = b("/static/common/ui/tip/tip.js");
    b("/static/common/ui/editor/fileUploader/fileUploader.js");
    s.swf = g.swf;
    window.UEDITOR_CONFIG = G;
    UE.I18N = m;
    var E = UE.browser = function() {
        var K = navigator.userAgent.toLowerCase(),
        I = window.opera,
        J = {
            ie: !!window.ActiveXObject,
            opera: ( !! I && I.version),
            webkit: (K.indexOf(" applewebkit/") > -1),
            mac: (K.indexOf("macintosh") > -1),
            quirks: (document.compatMode == "BackCompat")
        };
        J.gecko = (navigator.product == "Gecko" && !J.webkit && !J.opera);
        var H = 0;
        if (J.ie) {
            H = parseFloat(K.match(/msie (\d+)/)[1]);
            J.ie9Compat = document.documentMode == 9;
            J.ie8 = !!document.documentMode;
            J.ie8Compat = document.documentMode == 8;
            J.ie7Compat = ((H == 7 && !document.documentMode) || document.documentMode == 7);
            J.ie6Compat = (H < 7 || J.quirks)
        }
        if (J.gecko) {
            var L = K.match(/rv:([\d\.]+)/);
            if (L) {
                L = L[1].split(".");
                H = L[0] * 10000 + (L[1] || 0) * 100 + (L[2] || 0) * 1
            }
        }
        if (/chrome\/(\d+\.\d)/i.test(K)) {
            J.chrome = +RegExp["\x241"]
        }
        if (/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(K) && !/chrome/i.test(K)) {
            J.safari = +(RegExp["\x241"] || RegExp["\x242"])
        }
        if (J.opera) {
            H = parseFloat(I.version())
        }
        if (J.webkit) {
            H = parseFloat(K.match(/ applewebkit\/(\d+)/)[1])
        }
        J.version = H;
        J.isCompatible = !J.mobile && ((J.ie && H >= 6) || (J.gecko && H >= 10801) || (J.opera && H >= 9.5) || (J.air && H >= 1) || (J.webkit && H >= 522) || false);
        return J
    } ();
    var t = E.ie,
    c = E.webkit,
    n = E.gecko,
    z = E.opera;
    var C = UE.utils = {
        each: function(M, L, K) {
            if (M == null) {
                return
            }
            if (M.length === +M.length) {
                for (var J = 0,
                H = M.length; J < H; J++) {
                    if (L.call(K, M[J], J, M) === false) {
                        return false
                    }
                }
            } else {
                for (var I in M) {
                    if (M.hasOwnProperty(I)) {
                        if (L.call(K, M[I], I, M) === false) {
                            return false
                        }
                    }
                }
            }
        },
        makeInstance: function(I) {
            var H = new Function();
            H.prototype = I;
            I = new H;
            H.prototype = null;
            return I
        },
        extend: function(J, K, H) {
            if (K) {
                for (var I in K) {
                    if (!H || !J.hasOwnProperty(I)) {
                        J[I] = K[I]
                    }
                }
            }
            return J
        },
        extend2: function(L) {
            var I = arguments;
            for (var K = 1; K < I.length; K++) {
                var H = I[K];
                for (var J in H) {
                    if (!L.hasOwnProperty(J)) {
                        L[J] = H[J]
                    }
                }
            }
            return L
        },
        inherits: function(K, I) {
            var H = K.prototype,
            J = C.makeInstance(I.prototype);
            C.extend(J, H, true);
            K.prototype = J;
            return (J.constructor = K)
        },
        bind: function(I, H) {
            return function() {
                return I.apply(H, arguments)
            }
        },
        defer: function(I, H, J) {
            var K;
            return function() {
                if (J) {
                    clearTimeout(K)
                }
                K = setTimeout(I, H)
            }
        },
        indexOf: function(K, I, J) {
            var H = -1;
            J = this.isNumber(J) ? J: 0;
            this.each(K,
            function(L, M) {
                if (M >= J && L === I) {
                    H = M;
                    return false
                }
            });
            return H
        },
        removeItem: function(K, J) {
            for (var I = 0,
            H = K.length; I < H; I++) {
                if (K[I] === J) {
                    K.splice(I, 1);
                    I--
                }
            }
        },
        trim: function(H) {
            return H.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "")
        },
        listToMap: function(J) {
            if (!J) {
                return {}
            }
            J = C.isArray(J) ? J: J.split(",");
            for (var I = 0,
            H, K = {}; H = J[I++];) {
                K[H.toUpperCase()] = K[H] = 1
            }
            return K
        },
        unhtml: function(I, H) {
            return I ? I.replace(H || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#92|#47);)?/g,
            function(K, J) {
                if (J) {
                    return K
                } else {
                    return {
                        "<": "&lt;",
                        "&": "&amp;",
                        '"': "&quot;",
                        ">": "&gt;",
                        "'": "&#39;"
                    } [K]
                }
            }) : ""
        },
        html: function(H) {
            return H ? H.replace(/&((g|l|quo)t|amp|#39);/g,
            function(I) {
                return {
                    "&lt;": "<",
                    "&amp;": "&",
                    "&quot;": '"',
                    "&gt;": ">",
                    "&#39;": "'"
                } [I]
            }) : ""
        },
        cssStyleToDomStyle: function() {
            var I = document.createElement("div").style,
            H = {
                "float": I.cssFloat != undefined ? "cssFloat": I.styleFloat != undefined ? "styleFloat": "float"
            };
            return function(J) {
                return H[J] || (H[J] = J.toLowerCase().replace(/-./g,
                function(K) {
                    return K.charAt(1).toUpperCase()
                }))
            }
        } (),
        loadFile: function() {
            var H = [];
            function I(N, M) {
                try {
                    for (var K = 0,
                    J; J = H[K++];) {
                        if (J.doc === N && J.url == (M.src || M.href)) {
                            return J
                        }
                    }
                } catch(L) {
                    return null
                }
            }
            return function(P, O, L) {
                var M = I(P, O);
                if (M) {
                    if (M.ready) {
                        L && L()
                    } else {
                        M.funs.push(L)
                    }
                    return
                }
                H.push({
                    doc: P,
                    url: O.src || O.href,
                    funs: [L]
                });
                if (!P.body) {
                    var K = [];
                    for (var N in O) {
                        if (N == "tag") {
                            continue
                        }
                        K.push(N + '="' + O[N] + '"')
                    }
                    P.write("<" + O.tag + " " + K.join(" ") + " ></" + O.tag + ">");
                    return
                }
                if (O.id && P.getElementById(O.id)) {
                    return
                }
                var J = P.createElement(O.tag);
                delete O.tag;
                for (var N in O) {
                    J.setAttribute(N, O[N])
                }
                J.onload = J.onreadystatechange = function() {
                    if (!this.readyState || /loaded|complete/.test(this.readyState)) {
                        M = I(P, O);
                        if (M.funs.length > 0) {
                            M.ready = 1;
                            for (var Q; Q = M.funs.pop();) {
                                Q()
                            }
                        }
                        J.onload = J.onreadystatechange = null
                    }
                };
                J.onerror = function() {
                    throw Error("The load " + (O.href || O.src) + " fails,check the url settings of file ueditor.config.js ")
                };
                P.getElementsByTagName("head")[0].appendChild(J)
            }
        } (),
        isEmptyObject: function(I) {
            if (I == null) {
                return true
            }
            if (this.isArray(I) || this.isString(I)) {
                return I.length === 0
            }
            for (var H in I) {
                if (I.hasOwnProperty(H)) {
                    return false
                }
            }
            return true
        },
        fixColor: function(I, K) {
            if (/color/i.test(I) && /rgba?/.test(K)) {
                var L = K.split(",");
                if (L.length > 3) {
                    return ""
                }
                K = "#";
                for (var J = 0,
                H; H = L[J++];) {
                    H = parseInt(H.replace(/[^\d]/gi, ""), 10).toString(16);
                    K += H.length == 1 ? "0" + H: H
                }
                K = K.toUpperCase()
            }
            return K
        },
        optCss: function(L) {
            var K, J, H;
            L = L.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,
            function(P, N, M, O) {
                if (O.split(" ").length == 1) {
                    switch (N) {
                        case "padding":
                            !K && (K = {});
                            K[M] = O;
                            return "";
                        case "margin":
                            !J && (J = {});
                            J[M] = O;
                            return "";
                        case "border":
                            return O == "initial" ? "": P
                    }
                }
                return P
            });
            function I(S, O) {
                if (!S) {
                    return ""
                }
                var P = S.top,
                M = S.bottom,
                N = S.left,
                Q = S.right,
                T = "";
                if (!P || !N || !M || !Q) {
                    for (var R in S) {
                        T += ";" + O + "-" + R + ":" + S[R] + ";"
                    }
                } else {
                    T += ";" + O + ":" + (P == M && M == N && N == Q ? P: P == M && N == Q ? (P + " " + N) : N == Q ? (P + " " + N + " " + M) : (P + " " + Q + " " + M + " " + N)) + ";"
                }
                return T
            }
            L += I(K, "padding") + I(J, "margin");
            return L.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/, "").replace(/;([ \n\r\t]+)|\1;/g, ";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,
            function(N, M) {
                return M ? M + ";;": ";"
            })
        },
        clone: function(J, K) {
            var I;
            K = K || {};
            for (var H in J) {
                if (J.hasOwnProperty(H)) {
                    I = J[H];
                    if (typeof I == "object") {
                        K[H] = C.isArray(I) ? [] : {};
                        C.clone(J[H], K[H])
                    } else {
                        K[H] = I
                    }
                }
            }
            return K
        },
        transUnitToPx: function(I) {
            if (!/(pt|cm)/.test(I)) {
                return I
            }
            var H;
            I.replace(/([\d.]+)(\w+)/,
            function(L, J, K) {
                I = J;
                H = K
            });
            switch (H) {
                case "cm":
                    I = parseFloat(I) * 25;
                    break;
                case "pt":
                    I = Math.round(parseFloat(I) * 96 / 72)
            }
            return I + (I ? "px": "")
        },
        domReady: function() {
            var H = [];
            function I(K) {
                K.isReady = true;
                for (var J; J = H.pop(); J()) {}
            }
            return function(J, L) {
                L = L || window;
                var K = L.document;
                J && H.push(J);
                if (K.readyState === "complete") {
                    I(K)
                } else {
                    K.isReady && I(K);
                    if (E.ie) { (function() {
                        if (K.isReady) {
                            return
                        }
                        try {
                            K.documentElement.doScroll("left")
                        } catch(M) {
                            setTimeout(arguments.callee, 0);
                            return
                        }
                        I(K)
                    })();
                        L.attachEvent("onload",
                        function() {
                            I(K)
                        })
                    } else {
                        K.addEventListener("DOMContentLoaded",
                        function() {
                            K.removeEventListener("DOMContentLoaded", arguments.callee, false);
                            I(K)
                        },
                        false);
                        L.addEventListener("load",
                        function() {
                            I(K)
                        },
                        false)
                    }
                }
            }
        } (),
        cssRule: E.ie ?
        function(K, L, M) {
            var H, J;
            M = M || document;
            if (M.indexList) {
                H = M.indexList
            } else {
                H = M.indexList = {}
            }
            var I;
            if (!H[K]) {
                if (L === undefined) {
                    return ""
                }
                I = M.createStyleSheet("", J = M.styleSheets.length);
                H[K] = J
            } else {
                I = M.styleSheets[H[K]]
            }
            if (L === undefined) {
                return I.cssText
            }
            I.cssText = L || ""
        }: function(I, J, L) {
            L = L || document;
            var H = L.getElementsByTagName("head")[0],
            K;
            if (! (K = L.getElementById(I))) {
                if (J === undefined) {
                    return ""
                }
                K = L.createElement("style");
                K.id = I;
                H.appendChild(K)
            }
            if (J === undefined) {
                return K.innerHTML
            }
            if (J !== "") {
                K.innerHTML = J
            } else {
                H.removeChild(K)
            }
        },
        sort: function(N, M) {
            M = M ||
            function(P, O) {
                return P.localeCompare(O)
            };
            for (var K = 0,
            H = N.length; K < H; K++) {
                for (var I = K,
                L = N.length; I < L; I++) {
                    if (M(N[K], N[I]) > 0) {
                        var J = N[K];
                        N[K] = N[I];
                        N[I] = J
                    }
                }
            }
            return N
        }
    };
    C.each(["String", "Function", "Array", "Number", "RegExp", "Object"],
    function(H) {
        UE.utils["is" + H] = function(I) {
            return Object.prototype.toString.apply(I) == "[object " + H + "]"
        }
    });
    var f = UE.EventBase = function() {};
    f.prototype = {
        addListener: function(I, K) {
            I = C.trim(I).split(" ");
            for (var H = 0,
            J; J = I[H++];) {
                e(this, J, true).push(K)
            }
        },
        removeListener: function(I, K) {
            I = C.trim(I).split(" ");
            for (var H = 0,
            J; J = I[H++];) {
                C.removeItem(e(this, J) || [], K)
            }
        },
        fireEvent: function() {
            var K = arguments[0];
            K = C.trim(K).split(" ");
            for (var J = 0,
            M; M = K[J++];) {
                var L = e(this, M),
                N,
                I,
                H;
                if (L) {
                    H = L.length;
                    while (H--) {
                        if (!L[H]) {
                            continue
                        }
                        I = L[H].apply(this, arguments);
                        if (I === true) {
                            return I
                        }
                        if (I !== undefined) {
                            N = I
                        }
                    }
                }
                if (I = this["on" + M.toLowerCase()]) {
                    N = I.apply(this, arguments)
                }
            }
            return N
        }
    };
    function e(K, I, J) {
        var H;
        I = I.toLowerCase();
        return ((H = (K.__allListeners || J && (K.__allListeners = {}))) && (H[I] || J && (H[I] = [])))
    }
    var u = y.dtd = (function() {
        function ax(I) {
            for (var H in I) {
                I[H.toUpperCase()] = I[H]
            }
            return I
        }
        var W = C.extend2;
        var aw = ax({
            isindex: 1,
            fieldset: 1
        }),
        av = ax({
            input: 1,
            button: 1,
            select: 1,
            textarea: 1,
            label: 1
        }),
        au = W(ax({
            a: 1
        }), av),
        at = W({
            iframe: 1
        },
        au),
        ar = ax({
            hr: 1,
            ul: 1,
            menu: 1,
            div: 1,
            blockquote: 1,
            noscript: 1,
            table: 1,
            center: 1,
            address: 1,
            dir: 1,
            pre: 1,
            h5: 1,
            dl: 1,
            h4: 1,
            noframes: 1,
            h6: 1,
            ol: 1,
            h1: 1,
            h3: 1,
            h2: 1
        }),
        aq = ax({
            ins: 1,
            del: 1,
            script: 1,
            style: 1
        }),
        ap = W(ax({
            b: 1,
            acronym: 1,
            bdo: 1,
            "var": 1,
            "#": 1,
            abbr: 1,
            code: 1,
            br: 1,
            i: 1,
            cite: 1,
            kbd: 1,
            u: 1,
            strike: 1,
            s: 1,
            tt: 1,
            strong: 1,
            q: 1,
            samp: 1,
            em: 1,
            dfn: 1,
            span: 1
        }), aq),
        ao = W(ax({
            sub: 1,
            img: 1,
            embed: 1,
            object: 1,
            sup: 1,
            basefont: 1,
            map: 1,
            applet: 1,
            font: 1,
            big: 1,
            small: 1
        }), ap),
        an = W(ax({
            p: 1
        }), ao),
        am = W(ax({
            iframe: 1
        }), ao, av),
        ak = ax({
            img: 1,
            embed: 1,
            noscript: 1,
            br: 1,
            kbd: 1,
            center: 1,
            button: 1,
            basefont: 1,
            h5: 1,
            h4: 1,
            samp: 1,
            h6: 1,
            ol: 1,
            h1: 1,
            h3: 1,
            h2: 1,
            form: 1,
            font: 1,
            "#": 1,
            select: 1,
            menu: 1,
            ins: 1,
            abbr: 1,
            label: 1,
            code: 1,
            table: 1,
            script: 1,
            cite: 1,
            input: 1,
            iframe: 1,
            strong: 1,
            textarea: 1,
            noframes: 1,
            big: 1,
            small: 1,
            span: 1,
            hr: 1,
            sub: 1,
            bdo: 1,
            "var": 1,
            div: 1,
            object: 1,
            sup: 1,
            strike: 1,
            dir: 1,
            map: 1,
            dl: 1,
            applet: 1,
            del: 1,
            isindex: 1,
            fieldset: 1,
            ul: 1,
            b: 1,
            acronym: 1,
            a: 1,
            blockquote: 1,
            i: 1,
            u: 1,
            s: 1,
            tt: 1,
            address: 1,
            q: 1,
            pre: 1,
            p: 1,
            em: 1,
            dfn: 1
        }),
        aj = W(ax({
            a: 0
        }), am),
        ah = ax({
            tr: 1
        }),
        ag = ax({
            "#": 1
        }),
        af = W(ax({
            param: 1
        }), ak),
        ae = W(ax({
            form: 1
        }), aw, at, ar, an),
        ad = ax({
            li: 1,
            ol: 1,
            ul: 1
        }),
        ac = ax({
            style: 1,
            script: 1
        }),
        ab = ax({
            base: 1,
            link: 1,
            meta: 1,
            title: 1
        }),
        aa = W(ab, ac),
        Z = ax({
            head: 1,
            body: 1
        }),
        Y = ax({
            html: 1
        });
        var ai = ax({
            address: 1,
            blockquote: 1,
            center: 1,
            dir: 1,
            div: 1,
            dl: 1,
            fieldset: 1,
            form: 1,
            h1: 1,
            h2: 1,
            h3: 1,
            h4: 1,
            h5: 1,
            h6: 1,
            hr: 1,
            isindex: 1,
            menu: 1,
            noframes: 1,
            ol: 1,
            p: 1,
            pre: 1,
            table: 1,
            ul: 1
        }),
        al = ax({
            area: 1,
            base: 1,
            basefont: 1,
            br: 1,
            col: 1,
            command: 1,
            dialog: 1,
            embed: 1,
            hr: 1,
            img: 1,
            input: 1,
            isindex: 1,
            keygen: 1,
            link: 1,
            meta: 1,
            param: 1,
            source: 1,
            track: 1,
            wbr: 1
        });
        return ax({
            $nonBodyContent: W(Y, Z, ab),
            $block: ai,
            $inline: aj,
            $inlineWithA: W(ax({
                a: 1
            }), aj),
            $body: W(ax({
                script: 1,
                style: 1
            }), ai),
            $cdata: ax({
                script: 1,
                style: 1
            }),
            $empty: al,
            $nonChild: ax({
                iframe: 1,
                textarea: 1
            }),
            $listItem: ax({
                dd: 1,
                dt: 1,
                li: 1
            }),
            $list: ax({
                ul: 1,
                ol: 1,
                dl: 1
            }),
            $isNotEmpty: ax({
                table: 1,
                ul: 1,
                ol: 1,
                dl: 1,
                iframe: 1,
                area: 1,
                base: 1,
                col: 1,
                hr: 1,
                img: 1,
                embed: 1,
                input: 1,
                link: 1,
                meta: 1,
                param: 1,
                h1: 1,
                h2: 1,
                h3: 1,
                h4: 1,
                h5: 1,
                h6: 1
            }),
            $removeEmpty: ax({
                a: 1,
                abbr: 1,
                acronym: 1,
                address: 1,
                b: 1,
                bdo: 1,
                big: 1,
                cite: 1,
                code: 1,
                del: 1,
                dfn: 1,
                em: 1,
                font: 1,
                i: 1,
                ins: 1,
                label: 1,
                kbd: 1,
                q: 1,
                s: 1,
                samp: 1,
                small: 1,
                span: 1,
                strike: 1,
                strong: 1,
                sub: 1,
                sup: 1,
                tt: 1,
                u: 1,
                "var": 1
            }),
            $removeEmptyBlock: ax({
                p: 1,
                div: 1
            }),
            $tableContent: ax({
                caption: 1,
                col: 1,
                colgroup: 1,
                tbody: 1,
                td: 1,
                tfoot: 1,
                th: 1,
                thead: 1,
                tr: 1,
                table: 1
            }),
            $notTransContent: ax({
                pre: 1,
                script: 1,
                style: 1,
                textarea: 1
            }),
            html: Z,
            head: aa,
            style: ag,
            script: ag,
            body: ae,
            base: {},
            link: {},
            meta: {},
            title: ag,
            col: {},
            tr: ax({
                td: 1,
                th: 1
            }),
            img: {},
            embed: {},
            colgroup: ax({
                thead: 1,
                col: 1,
                tbody: 1,
                tr: 1,
                tfoot: 1
            }),
            noscript: ae,
            td: ae,
            br: {},
            th: ae,
            center: ae,
            kbd: aj,
            button: W(an, ar),
            basefont: {},
            h5: aj,
            h4: aj,
            samp: aj,
            h6: aj,
            ol: ad,
            h1: aj,
            h3: aj,
            option: ag,
            h2: aj,
            form: W(aw, at, ar, an),
            select: ax({
                optgroup: 1,
                option: 1
            }),
            font: aj,
            ins: aj,
            menu: ad,
            abbr: aj,
            label: aj,
            table: ax({
                thead: 1,
                col: 1,
                tbody: 1,
                tr: 1,
                colgroup: 1,
                caption: 1,
                tfoot: 1
            }),
            code: aj,
            tfoot: ah,
            cite: aj,
            li: ae,
            input: {},
            iframe: ae,
            strong: aj,
            textarea: ag,
            noframes: ae,
            big: aj,
            small: aj,
            span: ax({
                "#": 1,
                br: 1
            }),
            hr: aj,
            dt: aj,
            sub: aj,
            optgroup: ax({
                option: 1
            }),
            param: {},
            bdo: aj,
            "var": aj,
            div: ae,
            object: af,
            sup: aj,
            dd: ae,
            strike: aj,
            area: {},
            dir: ad,
            map: W(ax({
                area: 1,
                form: 1,
                p: 1
            }), aw, aq, ar),
            applet: af,
            dl: ax({
                dt: 1,
                dd: 1
            }),
            del: aj,
            isindex: {},
            fieldset: W(ax({
                legend: 1
            }), ak),
            thead: ah,
            ul: ad,
            acronym: aj,
            b: aj,
            a: W(ax({
                a: 1
            }), am),
            blockquote: W(ax({
                td: 1,
                tr: 1,
                tbody: 1,
                li: 1
            }), ae),
            caption: aj,
            i: aj,
            u: aj,
            tbody: ah,
            s: aj,
            address: W(at, an),
            tt: aj,
            legend: aj,
            q: aj,
            pre: W(ap, au),
            p: W(ax({
                a: 1
            }), aj),
            em: aj,
            dfn: aj
        })
    })();
    function r(N, O, I, H, L, M) {
        var K = H && N[O],
        J; ! K && (K = N[I]);
        while (!K && (J = (J || N).parentNode)) {
            if (J.tagName == "BODY" || M && !M(J)) {
                return null
            }
            K = J[I]
        }
        if (K && L && !L(K)) {
            return r(K, O, I, false, L)
        }
        return K
    }
    var p = t && E.version < 9 ? {
        tabindex: "tabIndex",
        readonly: "readOnly",
        "for": "htmlFor",
        "class": "className",
        maxlength: "maxLength",
        cellspacing: "cellSpacing",
        cellpadding: "cellPadding",
        rowspan: "rowSpan",
        colspan: "colSpan",
        usemap: "useMap",
        frameborder: "frameBorder"
    }: {
        tabindex: "tabIndex",
        readonly: "readOnly"
    },
    h = C.listToMap(["-webkit-box", "-moz-box", "block", "list-item", "table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption"]);
    var w = y.domUtils = {
        NODE_ELEMENT: 1,
        NODE_DOCUMENT: 9,
        NODE_TEXT: 3,
        NODE_COMMENT: 8,
        NODE_DOCUMENT_FRAGMENT: 11,
        POSITION_IDENTICAL: 0,
        POSITION_DISCONNECTED: 1,
        POSITION_FOLLOWING: 2,
        POSITION_PRECEDING: 4,
        POSITION_IS_CONTAINED: 8,
        POSITION_CONTAINS: 16,
        fillChar: t && E.version == "6" ? "\ufeff": "\u200B",
        keys: {
            8 : 1,
            46 : 1,
            16 : 1,
            17 : 1,
            18 : 1,
            37 : 1,
            38 : 1,
            39 : 1,
            40 : 1,
            13 : 1
        },
        getPosition: function(M, K) {
            if (M === K) {
                return 0
            }
            var I, L = [M],
            J = [K];
            I = M;
            while (I = I.parentNode) {
                if (I === K) {
                    return 10
                }
                L.push(I)
            }
            I = K;
            while (I = I.parentNode) {
                if (I === M) {
                    return 20
                }
                J.push(I)
            }
            L.reverse();
            J.reverse();
            if (L[0] !== J[0]) {
                return 1
            }
            var H = -1;
            while (H++, L[H] === J[H]) {}
            M = L[H];
            K = J[H];
            while (M = M.nextSibling) {
                if (M === K) {
                    return 4
                }
            }
            return 2
        },
        getNodeIndex: function(J, I) {
            var K = J,
            H = 0;
            while (K = K.previousSibling) {
                if (I && K.nodeType == 3) {
                    if (K.nodeType != K.nextSibling.nodeType) {
                        H++
                    }
                    continue
                }
                H++
            }
            return H
        },
        inDoc: function(H, I) {
            return w.getPosition(H, I) == 10
        },
        findParent: function(I, J, H) {
            if (I && !w.isBody(I)) {
                I = H ? I: I.parentNode;
                while (I) {
                    if (!J || J(I) || w.isBody(I)) {
                        return J && !J(I) && w.isBody(I) ? null: I
                    }
                    I = I.parentNode
                }
            }
            return null
        },
        findParentByTagName: function(J, H, I, K) {
            H = C.listToMap(C.isArray(H) ? H: [H]);
            return w.findParent(J,
            function(L) {
                return H[L.tagName] && !(K && K(L))
            },
            I)
        },
        findParents: function(K, J, L, I) {
            var H = J && (L && L(K) || !L) ? [K] : [];
            while (K = w.findParent(K, L)) {
                H.push(K)
            }
            return I ? H: H.reverse()
        },
        insertAfter: function(I, H) {
            return I.parentNode.insertBefore(H, I.nextSibling)
        },
        remove: function(I, J) {
            var H = I.parentNode,
            K;
            if (H) {
                if (J && I.hasChildNodes()) {
                    while (K = I.firstChild) {
                        H.insertBefore(K, I)
                    }
                }
                H.removeChild(I)
            }
            return I
        },
        getNextDomNode: function(J, H, K, I) {
            return r(J, "firstChild", "nextSibling", H, K, I)
        },
        isBookmarkNode: function(H) {
            return H.nodeType == 1 && H.id && /^_baidu_bookmark_/i.test(H.id)
        },
        getWindow: function(H) {
            var I = H.ownerDocument || H;
            return I.defaultView || I.parentWindow
        },
        getCommonAncestor: function(M, K) {
            if (M === K) {
                return M
            }
            var L = [M],
            J = [K],
            I = M,
            H = -1;
            while (I = I.parentNode) {
                if (I === K) {
                    return I
                }
                L.push(I)
            }
            I = K;
            while (I = I.parentNode) {
                if (I === M) {
                    return I
                }
                J.push(I)
            }
            L.reverse();
            J.reverse();
            while (H++, L[H] === J[H]) {}
            return H == 0 ? null: L[H - 1]
        },
        clearEmptySibling: function(K, I, J) {
            function H(N, L) {
                var M;
                while (N && !w.isBookmarkNode(N) && (w.isEmptyInlineElement(N) || !new RegExp("[^\t\n\r" + w.fillChar + "]").test(N.nodeValue))) {
                    M = N[L];
                    w.remove(N);
                    N = M
                }
            } ! I && H(K.nextSibling, "nextSibling"); ! J && H(K.previousSibling, "previousSibling")
        },
        split: function(K, M) {
            var L = K.ownerDocument;
            if (E.ie && M == K.nodeValue.length) {
                var J = L.createTextNode("");
                return w.insertAfter(K, J)
            }
            var H = K.splitText(M);
            if (E.ie8) {
                var I = L.createTextNode("");
                w.insertAfter(H, I);
                w.remove(I)
            }
            return H
        },
        isWhitespace: function(H) {
            return ! new RegExp("[^ \t\n\r" + w.fillChar + "]").test(H.nodeValue)
        },
        getXY: function(I) {
            var H = 0,
            J = 0;
            while (I.offsetParent) {
                J += I.offsetTop;
                H += I.offsetLeft;
                I = I.offsetParent
            }
            return {
                x: H,
                y: J
            }
        },
        on: function(L, N, M) {
            var K = C.isArray(N) ? N: [N],
            H = K.length;
            if (H) {
                while (H--) {
                    N = K[H];
                    if (L.addEventListener) {
                        L.addEventListener(N, M, false)
                    } else {
                        if (!M._d) {
                            M._d = {
                                els: []
                            }
                        }
                        var J = N + M.toString(),
                        I = C.indexOf(M._d.els, L);
                        if (!M._d[J] || I == -1) {
                            if (I == -1) {
                                M._d.els.push(L)
                            }
                            if (!M._d[J]) {
                                M._d[J] = function(O) {
                                    return M.call(O.srcElement, O || window.event)
                                }
                            }
                            L.attachEvent("on" + N, M._d[J])
                        }
                    }
                }
            }
            L = null
        },
        un: function(L, N, M) {
            var K = C.isArray(N) ? N: [N],
            H = K.length;
            if (H) {
                while (H--) {
                    N = K[H];
                    if (L.removeEventListener) {
                        L.removeEventListener(N, M, false)
                    } else {
                        var J = N + M.toString();
                        try {
                            L.detachEvent("on" + N, M._d ? M._d[J] : M)
                        } catch(O) {}
                        if (M._d && M._d[J]) {
                            var I = C.indexOf(M._d.els, L);
                            if (I != -1) {
                                M._d.els.splice(I, 1)
                            }
                            M._d.els.length == 0 && delete M._d[J]
                        }
                    }
                }
            }
        },
        isSameElement: function(K, J) {
            if (K.tagName != J.tagName) {
                return false
            }
            var L = K.attributes,
            N = J.attributes;
            if (!t && L.length != N.length) {
                return false
            }
            var H, P, O = 0,
            I = 0;
            for (var M = 0; H = L[M++];) {
                if (H.nodeName == "style") {
                    if (H.specified) {
                        O++
                    }
                    if (w.isSameStyle(K, J)) {
                        continue
                    } else {
                        return false
                    }
                }
                if (t) {
                    if (H.specified) {
                        O++;
                        P = N.getNamedItem(H.nodeName)
                    } else {
                        continue
                    }
                } else {
                    P = J.attributes[H.nodeName]
                }
                if (!P.specified || H.nodeValue != P.nodeValue) {
                    return false
                }
            }
            if (t) {
                for (M = 0; P = N[M++];) {
                    if (P.specified) {
                        I++
                    }
                }
                if (O != I) {
                    return false
                }
            }
            return true
        },
        isSameStyle: function(N, L) {
            var I = N.style.cssText.replace(/( ?; ?)/g, ";").replace(/( ?: ?)/g, ":"),
            H = L.style.cssText.replace(/( ?; ?)/g, ";").replace(/( ?: ?)/g, ":");
            if (E.opera) {
                I = N.style;
                H = L.style;
                if (I.length != H.length) {
                    return false
                }
                for (var M in I) {
                    if (/^(\d+|csstext)$/i.test(M)) {
                        continue
                    }
                    if (I[M] != H[M]) {
                        return false
                    }
                }
                return true
            }
            if (!I || !H) {
                return I == H
            }
            I = I.split(";");
            H = H.split(";");
            if (I.length != H.length) {
                return false
            }
            for (var K = 0,
            J; J = I[K++];) {
                if (C.indexOf(H, J) == -1) {
                    return false
                }
            }
            return true
        },
        isBlockElm: function(H) {
            return H.nodeType == 1 && (u.$block[H.tagName] || h[w.getComputedStyle(H, "display")]) && !u.$nonChild[H.tagName]
        },
        isBody: function(H) {
            return H && H.nodeType == 1 && H.tagName.toLowerCase() == "body"
        },
        breakParent: function(L, J) {
            var I, N = L,
            M = L,
            H, K;
            do {
                N = N.parentNode;
                if (H) {
                    I = N.cloneNode(false);
                    I.appendChild(H);
                    H = I;
                    I = N.cloneNode(false);
                    I.appendChild(K);
                    K = I
                } else {
                    H = N.cloneNode(false);
                    K = H.cloneNode(false)
                }
                while (I = M.previousSibling) {
                    H.insertBefore(I, H.firstChild)
                }
                while (I = M.nextSibling) {
                    K.appendChild(I)
                }
                M = N
            } while ( J !== N );
            I = J.parentNode;
            I.insertBefore(H, J);
            I.insertBefore(K, J);
            I.insertBefore(L, K);
            w.remove(J);
            return L
        },
        isEmptyInlineElement: function(H) {
            if (H.nodeType != 1 || !u.$removeEmpty[H.tagName]) {
                return 0
            }
            H = H.firstChild;
            while (H) {
                if (w.isBookmarkNode(H)) {
                    return 0
                }
                if (H.nodeType == 1 && !w.isEmptyInlineElement(H) || H.nodeType == 3 && !w.isWhitespace(H)) {
                    return 0
                }
                H = H.nextSibling
            }
            return 1
        },
        trimWhiteTextNode: function(I) {
            function H(J) {
                var K;
                while ((K = I[J]) && K.nodeType == 3 && w.isWhitespace(K)) {
                    I.removeChild(K)
                }
            }
            H("firstChild");
            H("lastChild")
        },
        mergeChild: function(J, I, N) {
            var M = w.getElementsByTagName(J, J.tagName.toLowerCase());
            for (var L = 0,
            P; P = M[L++];) {
                if (!P.parentNode || w.isBookmarkNode(P)) {
                    continue
                }
                if (P.tagName.toLowerCase() == "span") {
                    if (J === P.parentNode) {
                        w.trimWhiteTextNode(J);
                        if (J.childNodes.length == 1) {
                            J.style.cssText = P.style.cssText + ";" + J.style.cssText;
                            w.remove(P, true);
                            continue
                        }
                    }
                    P.style.cssText = J.style.cssText + ";" + P.style.cssText;
                    if (N) {
                        var H = N.style;
                        if (H) {
                            H = H.split(";");
                            for (var K = 0,
                            O; O = H[K++];) {
                                P.style[C.cssStyleToDomStyle(O.split(":")[0])] = O.split(":")[1]
                            }
                        }
                    }
                    if (w.isSameStyle(P, J)) {
                        w.remove(P, true)
                    }
                    continue
                }
                if (w.isSameElement(J, P)) {
                    w.remove(P, true)
                }
            }
        },
        getElementsByTagName: function(L, H, I) {
            if (I && C.isString(I)) {
                var P = I;
                I = function(R) {
                    return w.hasClass(R, P)
                }
            }
            H = C.trim(H).replace(/[ ]{2,}/g, " ").split(" ");
            var N = [];
            for (var K = 0,
            J; J = H[K++];) {
                var O = L.getElementsByTagName(J);
                for (var M = 0,
                Q; Q = O[M++];) {
                    if (!I || I(Q)) {
                        N.push(Q)
                    }
                }
            }
            return N
        },
        mergeToParent: function(I) {
            var H = I.parentNode;
            while (H && u.$removeEmpty[H.tagName]) {
                if (H.tagName == I.tagName || H.tagName == "A") {
                    w.trimWhiteTextNode(H);
                    if (H.tagName == "SPAN" && !w.isSameStyle(H, I) || (H.tagName == "A" && I.tagName == "SPAN")) {
                        if (H.childNodes.length > 1 || H !== I.parentNode) {
                            I.style.cssText = H.style.cssText + ";" + I.style.cssText;
                            H = H.parentNode;
                            continue
                        } else {
                            H.style.cssText += ";" + I.style.cssText;
                            if (H.tagName == "A") {
                                H.style.textDecoration = "underline"
                            }
                        }
                    }
                    if (H.tagName != "A") {
                        H === I.parentNode && w.remove(I, true);
                        break
                    }
                }
                H = H.parentNode
            }
        },
        mergeSibling: function(J, I, H) {
            function K(N, O, M) {
                var L;
                if ((L = M[N]) && !w.isBookmarkNode(L) && L.nodeType == 1 && w.isSameElement(M, L)) {
                    while (L.firstChild) {
                        if (O == "firstChild") {
                            M.insertBefore(L.lastChild, M.firstChild)
                        } else {
                            M.appendChild(L.firstChild)
                        }
                    }
                    w.remove(L)
                }
            } ! I && K("previousSibling", "firstChild", J); ! H && K("nextSibling", "lastChild", J)
        },
        unSelectable: t || E.opera ?
        function(J) {
            J.onselectstart = function() {
                return false
            };
            J.onclick = J.onkeyup = J.onkeydown = function() {
                return false
            };
            J.unselectable = "on";
            J.setAttribute("unselectable", "on");
            for (var I = 0,
            H; H = J.all[I++];) {
                switch (H.tagName.toLowerCase()) {
                    case "iframe":
                    case "textarea":
                    case "input":
                    case "select":
                        break;
                    default:
                        H.unselectable = "on";
                        J.setAttribute("unselectable", "on")
                }
            }
        }: function(H) {
            H.style.MozUserSelect = H.style.webkitUserSelect = H.style.KhtmlUserSelect = "none"
        },
        removeAttributes: function(J, K) {
            K = C.isArray(K) ? K: C.trim(K).replace(/[ ]{2,}/g, " ").split(" ");
            for (var I = 0,
            H; H = K[I++];) {
                H = p[H] || H;
                switch (H) {
                    case "className":
                        J[H] = "";
                        break;
                    case "style":
                        J.style.cssText = ""; ! E.ie && J.removeAttributeNode(J.getAttributeNode("style"))
                }
                J.removeAttribute(H)
            }
        },
        createElement: function(J, H, I) {
            return w.setAttributes(J.createElement(H), I)
        },
        setAttributes: function(J, I) {
            for (var H in I) {
                if (I.hasOwnProperty(H)) {
                    var K = I[H];
                    switch (H) {
                        case "class":
                            J.className = K;
                            break;
                        case "style":
                            J.style.cssText = J.style.cssText + ";" + K;
                            break;
                        case "innerHTML":
                            J[H] = K;
                            break;
                        case "value":
                            J.value = K;
                            break;
                        default:
                            J.setAttribute(p[H] || H, K)
                    }
                }
            }
            return J
        },
        getComputedStyle: function(J, I) {
            var M = "width height top left";
            if (M.indexOf(I) > -1) {
                return J["offset" + I.replace(/^\w/,
                function(O) {
                    return O.toUpperCase()
                })] + "px"
            }
            if (J.nodeType == 3) {
                J = J.parentNode
            }
            if (E.ie && E.version < 9 && I == "font-size" && !J.style.fontSize && !u.$empty[J.tagName] && !u.$nonChild[J.tagName]) {
                var K = J.ownerDocument.createElement("span");
                K.style.cssText = "padding:0;border:0;font-family:simsun;";
                K.innerHTML = ".";
                J.appendChild(K);
                var H = K.offsetHeight;
                J.removeChild(K);
                K = null;
                return H + "px"
            }
            try {
                var L = w.getStyle(J, I) || (window.getComputedStyle ? w.getWindow(J).getComputedStyle(J, "").getPropertyValue(I) : (J.currentStyle || J.style)[C.cssStyleToDomStyle(I)])
            } catch(N) {
                return ""
            }
            return C.transUnitToPx(C.fixColor(I, L))
        },
        removeClasses: function(L, K) {
            K = C.isArray(K) ? K: C.trim(K).replace(/[ ]{2,}/g, " ").split(" ");
            for (var J = 0,
            I, H = L.className; I = K[J++];) {
                H = H.replace(new RegExp("\\b" + I + "\\b"), "")
            }
            H = C.trim(H).replace(/[ ]{2,}/g, " ");
            if (H) {
                L.className = H
            } else {
                w.removeAttributes(L, ["class"])
            }
        },
        addClass: function(L, K) {
            if (!L) {
                return
            }
            K = C.trim(K).replace(/[ ]{2,}/g, " ").split(" ");
            for (var J = 0,
            I, H = L.className; I = K[J++];) {
                if (!new RegExp("\\b" + I + "\\b").test(H)) {
                    L.className += " " + I
                }
            }
        },
        hasClass: function(K, L) {
            if (C.isRegExp(L)) {
                return L.test(K.className)
            }
            L = C.trim(L).replace(/[ ]{2,}/g, " ").split(" ");
            for (var J = 0,
            I, H = K.className; I = L[J++];) {
                if (!new RegExp("\\b" + I + "\\b", "i").test(H)) {
                    return false
                }
            }
            return J - 1 == L.length
        },
        preventDefault: function(H) {
            H.preventDefault ? H.preventDefault() : (H.returnValue = false)
        },
        removeStyle: function(I, H) {
            if (E.ie) {
                I.style.cssText = I.style.cssText.replace(new RegExp(H + "[^:]*:[^;]+;?", "ig"), "")
            } else {
                if (I.style.removeProperty) {
                    I.style.removeProperty(H)
                } else {
                    I.style.removeAttribute(C.cssStyleToDomStyle(H))
                }
            }
            if (!I.style.cssText) {
                w.removeAttributes(I, ["style"])
            }
        },
        getStyle: function(I, H) {
            var J = I.style[C.cssStyleToDomStyle(H)];
            return C.fixColor(H, J)
        },
        setStyle: function(I, H, J) {
            I.style[C.cssStyleToDomStyle(H)] = J;
            if (!C.trim(I.style.cssText)) {
                this.removeAttributes(I, "style")
            }
        },
        setStyles: function(I, J) {
            for (var H in J) {
                if (J.hasOwnProperty(H)) {
                    w.setStyle(I, H, J[H])
                }
            }
        },
        removeDirtyAttr: function(K) {
            for (var J = 0,
            I, H = K.getElementsByTagName("*"); I = H[J++];) {
                I.removeAttribute("_moz_dirty")
            }
            K.removeAttribute("_moz_dirty")
        },
        getChildCount: function(J, H) {
            var I = 0,
            K = J.firstChild;
            H = H ||
            function() {
                return 1
            };
            while (K) {
                if (H(K)) {
                    I++
                }
                K = K.nextSibling
            }
            return I
        },
        isEmptyNode: function(H) {
            return ! H.firstChild || w.getChildCount(H,
            function(I) {
                return ! w.isBr(I) && !w.isBookmarkNode(I) && !w.isWhitespace(I)
            }) == 0
        },
        clearSelectedArr: function(H) {
            var I;
            while (I = H.pop()) {
                w.removeAttributes(I, ["class"])
            }
        },
        scrollToView: function(J, P, H) {
            var I = function() {
                var Q = P.document,
                R = Q.compatMode == "CSS1Compat";
                return {
                    width: (R ? Q.documentElement.clientWidth: Q.body.clientWidth) || 0,
                    height: (R ? Q.documentElement.clientHeight: Q.body.clientHeight) || 0
                }
            },
            O = function(R) {
                if ("pageXOffset" in R) {
                    return {
                        x: R.pageXOffset || 0,
                        y: R.pageYOffset || 0
                    }
                } else {
                    var Q = R.document;
                    return {
                        x: Q.documentElement.scrollLeft || Q.body.scrollLeft || 0,
                        y: Q.documentElement.scrollTop || Q.body.scrollTop || 0
                    }
                }
            };
            var M = I().height,
            N = M * -1 + H;
            N += (J.offsetHeight || 0);
            var K = w.getXY(J);
            N += K.y;
            var L = O(P).y;
            if (N > L || N < L - M) {
                P.scrollTo(0, N + (N < 0 ? -20 : 20))
            }
        },
        isBr: function(H) {
            return H.nodeType == 1 && H.tagName == "BR"
        },
        isFillChar: function(H, I) {
            return H.nodeType == 3 && !H.nodeValue.replace(new RegExp((I ? "^": "") + w.fillChar), "").length
        },
        isStartInblock: function(I) {
            var M = I.cloneRange(),
            H = 0,
            N = M.startContainer,
            J;
            if (N.nodeType == 1 && N.childNodes[M.startOffset]) {
                N = N.childNodes[M.startOffset];
                var L = N.previousSibling;
                while (L && w.isFillChar(L)) {
                    N = L;
                    L = L.previousSibling
                }
            }
            if (this.isFillChar(N, true) && M.startOffset == 1) {
                M.setStartBefore(N);
                N = M.startContainer
            }
            while (N && w.isFillChar(N)) {
                J = N;
                N = N.previousSibling
            }
            if (J) {
                M.setStartBefore(J);
                N = M.startContainer
            }
            if (N.nodeType == 1 && w.isEmptyNode(N) && M.startOffset == 1) {
                M.setStart(N, 0).collapse(true)
            }
            while (!M.startOffset) {
                N = M.startContainer;
                if (w.isBlockElm(N) || w.isBody(N)) {
                    H = 1;
                    break
                }
                var L = M.startContainer.previousSibling,
                K;
                if (!L) {
                    M.setStartBefore(M.startContainer)
                } else {
                    while (L && w.isFillChar(L)) {
                        K = L;
                        L = L.previousSibling
                    }
                    if (K) {
                        M.setStartBefore(K)
                    } else {
                        M.setStartBefore(M.startContainer)
                    }
                }
            }
            return H && !w.isBody(M.startContainer) ? 1 : 0
        },
        isEmptyBlock: function(I, H) {
            H = H || new RegExp("[ \t\r\n" + w.fillChar + "]", "g");
            if (I[E.ie ? "innerText": "textContent"].replace(H, "").length > 0) {
                return 0
            }
            for (var J in u.$isNotEmpty) {
                if (I.getElementsByTagName(J).length) {
                    return 0
                }
            }
            return 1
        },
        setViewportOffset: function(H, N) {
            var M = parseInt(H.style.left) | 0;
            var L = parseInt(H.style.top) | 0;
            var J = H.getBoundingClientRect();
            var K = N.left - J.left;
            var I = N.top - J.top;
            if (K) {
                H.style.left = M + K + "px"
            }
            if (I) {
                H.style.top = L + I + "px"
            }
        },
        fillNode: function(J, I) {
            var H = E.ie ? J.createTextNode(w.fillChar) : J.createElement("br");
            I.innerHTML = "";
            I.appendChild(H)
        },
        moveChild: function(J, H, I) {
            while (J.firstChild) {
                if (I && H.firstChild) {
                    H.insertBefore(J.lastChild, H.firstChild)
                } else {
                    H.appendChild(J.firstChild)
                }
            }
        },
        hasNoAttributes: function(H) {
            return E.ie ? /^<\w+\s*?>/.test(H.outerHTML) : H.attributes.length == 0
        },
        isCustomeNode: function(H) {
            return H.nodeType == 1 && H.getAttribute("_ue_custom_node_")
        },
        isTagNode: function(I, H) {
            return I.nodeType == 1 && new RegExp(I.tagName, "i").test(H)
        },
        filterNodeList: function(K, J, I) {
            var H = [];
            if (!C.isFunction(J)) {
                var L = J;
                J = function(M) {
                    return C.indexOf(C.isArray(L) ? L: L.split(" "), M.tagName.toLowerCase()) != -1
                }
            }
            C.each(K,
            function(M) {
                J(M) && H.push(M)
            });
            return H.length == 0 ? null: H.length == 1 || !I ? H[0] : H
        },
        isInNodeEndBoundary: function(H, I) {
            var J = H.startContainer;
            if (J.nodeType == 3 && H.startOffset != J.nodeValue.length) {
                return 0
            }
            if (J.nodeType == 1 && H.startOffset != J.childNodes.length) {
                return 0
            }
            while (J !== I) {
                if (J.nextSibling) {
                    return 0
                }
                J = J.parentNode
            }
            return 1
        },
        isBoundaryNode: function(J, H) {
            var I;
            while (!w.isBody(J)) {
                I = J;
                J = J.parentNode;
                if (I !== J[H]) {
                    return false
                }
            }
            return true
        }
    };
    var x = new RegExp(w.fillChar, "g"); (function() {
        var M = 0,
        N = w.fillChar,
        J;
        function I(R) {
            R.collapsed = R.startContainer && R.endContainer && R.startContainer === R.endContainer && R.startOffset == R.endOffset
        }
        function Q(R) {
            return ! R.collapsed && R.startContainer.nodeType == 1 && R.startContainer === R.endContainer && R.endOffset - R.startOffset == 1
        }
        function H(S, T, U, R) {
            if (T.nodeType == 1 && (u.$empty[T.tagName] || u.$nonChild[T.tagName])) {
                U = w.getNodeIndex(T) + (S ? 0 : 1);
                T = T.parentNode
            }
            if (S) {
                R.startContainer = T;
                R.startOffset = U;
                if (!R.endContainer) {
                    R.collapse(true)
                }
            } else {
                R.endContainer = T;
                R.endOffset = U;
                if (!R.startContainer) {
                    R.collapse(false)
                }
            }
            I(R);
            return R
        }
        function P(X, ab) {
            var V = X.startContainer,
            U = X.endContainer,
            ad = X.startOffset,
            W = X.endOffset,
            aj = X.document,
            R = aj.createDocumentFragment(),
            Y,
            aa;
            if (V.nodeType == 1) {
                V = V.childNodes[ad] || (Y = V.appendChild(aj.createTextNode("")))
            }
            if (U.nodeType == 1) {
                U = U.childNodes[W] || (aa = U.appendChild(aj.createTextNode("")))
            }
            if (V === U && V.nodeType == 3) {
                R.appendChild(aj.createTextNode(V.substringData(ad, W - ad)));
                if (ab) {
                    V.deleteData(ad, W - ad);
                    X.collapse(true)
                }
                return R
            }
            var Z, af, ah = R,
            ag = w.findParents(V, true),
            S = w.findParents(U, true);
            for (var ae = 0; ag[ae] == S[ae];) {
                ae++
            }
            for (var ac = ae,
            ai; ai = ag[ac]; ac++) {
                Z = ai.nextSibling;
                if (ai == V) {
                    if (!Y) {
                        if (X.startContainer.nodeType == 3) {
                            ah.appendChild(aj.createTextNode(V.nodeValue.slice(ad)));
                            if (ab) {
                                V.deleteData(ad, V.nodeValue.length - ad)
                            }
                        } else {
                            ah.appendChild(!ab ? V.cloneNode(true) : V)
                        }
                    }
                } else {
                    af = ai.cloneNode(false);
                    ah.appendChild(af)
                }
                while (Z) {
                    if (Z === U || Z === S[ac]) {
                        break
                    }
                    ai = Z.nextSibling;
                    ah.appendChild(!ab ? Z.cloneNode(true) : Z);
                    Z = ai
                }
                ah = af
            }
            ah = R;
            if (!ag[ae]) {
                ah.appendChild(ag[ae - 1].cloneNode(false));
                ah = ah.firstChild
            }
            for (var ac = ae,
            T; T = S[ac]; ac++) {
                Z = T.previousSibling;
                if (T == U) {
                    if (!aa && X.endContainer.nodeType == 3) {
                        ah.appendChild(aj.createTextNode(U.substringData(0, W)));
                        if (ab) {
                            U.deleteData(0, W)
                        }
                    }
                } else {
                    af = T.cloneNode(false);
                    ah.appendChild(af)
                }
                if (ac != ae || !ag[ae]) {
                    while (Z) {
                        if (Z === V) {
                            break
                        }
                        T = Z.previousSibling;
                        ah.insertBefore(!ab ? Z.cloneNode(true) : Z, ah.firstChild);
                        Z = T
                    }
                }
                ah = af
            }
            if (ab) {
                X.setStartBefore(!S[ae] ? S[ae - 1] : !ag[ae] ? ag[ae - 1] : S[ae]).collapse(true)
            }
            Y && w.remove(Y);
            aa && w.remove(aa);
            return R
        }
        var K = y.Range = function(R) {
            var S = this;
            S.startContainer = S.startOffset = S.endContainer = S.endOffset = null;
            S.document = R;
            S.collapsed = true
        };
        function L(U, R) {
            try {
                if (J && w.inDoc(J, U)) {
                    if (!J.nodeValue.replace(x, "").length) {
                        var S = J.parentNode;
                        w.remove(J);
                        while (S && w.isEmptyInlineElement(S) && (E.safari ? !(w.getPosition(S, R) & w.POSITION_CONTAINS) : !S.contains(R))) {
                            J = S.parentNode;
                            w.remove(S);
                            S = J
                        }
                    } else {
                        J.nodeValue = J.nodeValue.replace(x, "")
                    }
                }
            } catch(T) {}
        }
        function O(T, R) {
            var S;
            T = T[R];
            while (T && w.isFillChar(T)) {
                S = T[R];
                w.remove(T);
                T = S
            }
        }
        K.prototype = {
            cloneContents: function() {
                return this.collapsed ? null: P(this, 0)
            },
            deleteContents: function() {
                var R;
                if (!this.collapsed) {
                    P(this, 1)
                }
                if (E.webkit) {
                    R = this.startContainer;
                    if (R.nodeType == 3 && !R.nodeValue.length) {
                        this.setStartBefore(R).collapse(true);
                        w.remove(R)
                    }
                }
                return this
            },
            extractContents: function() {
                return this.collapsed ? null: P(this, 2)
            },
            setStart: function(R, S) {
                return H(true, R, S, this)
            },
            setEnd: function(R, S) {
                return H(false, R, S, this)
            },
            setStartAfter: function(R) {
                return this.setStart(R.parentNode, w.getNodeIndex(R) + 1)
            },
            setStartBefore: function(R) {
                return this.setStart(R.parentNode, w.getNodeIndex(R))
            },
            setEndAfter: function(R) {
                return this.setEnd(R.parentNode, w.getNodeIndex(R) + 1)
            },
            setEndBefore: function(R) {
                return this.setEnd(R.parentNode, w.getNodeIndex(R))
            },
            setStartAtFirst: function(R) {
                return this.setStart(R, 0)
            },
            setStartAtLast: function(R) {
                return this.setStart(R, R.nodeType == 3 ? R.nodeValue.length: R.childNodes.length)
            },
            setEndAtFirst: function(R) {
                return this.setEnd(R, 0)
            },
            setEndAtLast: function(R) {
                return this.setEnd(R, R.nodeType == 3 ? R.nodeValue.length: R.childNodes.length)
            },
            selectNode: function(R) {
                return this.setStartBefore(R).setEndAfter(R)
            },
            selectNodeContents: function(R) {
                return this.setStart(R, 0).setEndAtLast(R)
            },
            cloneRange: function() {
                var R = this;
                return new K(R.document).setStart(R.startContainer, R.startOffset).setEnd(R.endContainer, R.endOffset)
            },
            collapse: function(R) {
                var S = this;
                if (R) {
                    S.endContainer = S.startContainer;
                    S.endOffset = S.startOffset
                } else {
                    S.startContainer = S.endContainer;
                    S.startOffset = S.endOffset
                }
                S.collapsed = true;
                return S
            },
            shrinkBoundary: function(T) {
                var S = this,
                V, U = S.collapsed;
                function R(W) {
                    return W.nodeType == 1 && !w.isBookmarkNode(W) && !u.$empty[W.tagName] && !u.$nonChild[W.tagName]
                }
                while (S.startContainer.nodeType == 1 && (V = S.startContainer.childNodes[S.startOffset]) && R(V)) {
                    S.setStart(V, 0)
                }
                if (U) {
                    return S.collapse(true)
                }
                if (!T) {
                    while (S.endContainer.nodeType == 1 && S.endOffset > 0 && (V = S.endContainer.childNodes[S.endOffset - 1]) && R(V)) {
                        S.setEnd(V, V.childNodes.length)
                    }
                }
                return S
            },
            getCommonAncestor: function(S, T) {
                var U = this,
                V = U.startContainer,
                R = U.endContainer;
                if (V === R) {
                    if (S && Q(this)) {
                        V = V.childNodes[U.startOffset];
                        if (V.nodeType == 1) {
                            return V
                        }
                    }
                    return T && V.nodeType == 3 ? V.parentNode: V
                }
                return w.getCommonAncestor(V, R)
            },
            trimBoundary: function(S) {
                this.txtToElmBoundary();
                var W = this.startContainer,
                V = this.startOffset,
                U = this.collapsed,
                R = this.endContainer;
                if (W.nodeType == 3) {
                    if (V == 0) {
                        this.setStartBefore(W)
                    } else {
                        if (V >= W.nodeValue.length) {
                            this.setStartAfter(W)
                        } else {
                            var T = w.split(W, V);
                            if (W === R) {
                                this.setEnd(T, this.endOffset - V)
                            } else {
                                if (W.parentNode === R) {
                                    this.endOffset += 1
                                }
                            }
                            this.setStartBefore(T)
                        }
                    }
                    if (U) {
                        return this.collapse(true)
                    }
                }
                if (!S) {
                    V = this.endOffset;
                    R = this.endContainer;
                    if (R.nodeType == 3) {
                        if (V == 0) {
                            this.setEndBefore(R)
                        } else {
                            V < R.nodeValue.length && w.split(R, V);
                            this.setEndAfter(R)
                        }
                    }
                }
                return this
            },
            txtToElmBoundary: function() {
                function R(T, V) {
                    var S = T[V + "Container"],
                    U = T[V + "Offset"];
                    if (S.nodeType == 3) {
                        if (!U) {
                            T["set" + V.replace(/(\w)/,
                            function(W) {
                                return W.toUpperCase()
                            }) + "Before"](S)
                        } else {
                            if (U >= S.nodeValue.length) {
                                T["set" + V.replace(/(\w)/,
                                function(W) {
                                    return W.toUpperCase()
                                }) + "After"](S)
                            }
                        }
                    }
                }
                if (!this.collapsed) {
                    R(this, "start");
                    R(this, "end")
                }
                return this
            },
            insertNode: function(T) {
                var V = T,
                S = 1;
                if (T.nodeType == 11) {
                    V = T.firstChild;
                    S = T.childNodes.length
                }
                this.trimBoundary(true);
                var W = this.startContainer,
                U = this.startOffset;
                var R = W.childNodes[U];
                if (R) {
                    W.insertBefore(T, R)
                } else {
                    W.appendChild(T)
                }
                if (V.parentNode === this.endContainer) {
                    this.endOffset = this.endOffset + S
                }
                return this.setStartBefore(V)
            },
            setCursor: function(S, R) {
                return this.collapse(!S).select(R)
            },
            createBookmark: function(T, U) {
                var R, S = this.document.createElement("span");
                S.style.cssText = "display:none;line-height:0px;";
                S.appendChild(this.document.createTextNode("\u200D"));
                S.id = "_baidu_bookmark_start_" + (U ? "": M++);
                if (!this.collapsed) {
                    R = S.cloneNode(true);
                    R.id = "_baidu_bookmark_end_" + (U ? "": M++)
                }
                this.insertNode(S);
                if (R) {
                    this.collapse().insertNode(R).setEndBefore(R)
                }
                this.setStartAfter(S);
                return {
                    start: T ? S.id: S,
                    end: R ? T ? R.id: R: null,
                    id: T
                }
            },
            moveToBookmark: function(S) {
                var T = S.id ? this.document.getElementById(S.start) : S.start,
                R = S.end && S.id ? this.document.getElementById(S.end) : S.end;
                this.setStartBefore(T);
                w.remove(T);
                if (R) {
                    this.setEndBefore(R);
                    w.remove(R)
                } else {
                    this.collapse(true)
                }
                return this
            },
            enlarge: function(S, V) {
                var R = w.isBody,
                W, U, T = this.document.createTextNode("");
                if (S) {
                    U = this.startContainer;
                    if (U.nodeType == 1) {
                        if (U.childNodes[this.startOffset]) {
                            W = U = U.childNodes[this.startOffset]
                        } else {
                            U.appendChild(T);
                            W = U = T
                        }
                    } else {
                        W = U
                    }
                    while (1) {
                        if (w.isBlockElm(U)) {
                            U = W;
                            while ((W = U.previousSibling) && !w.isBlockElm(W)) {
                                U = W
                            }
                            this.setStartBefore(U);
                            break
                        }
                        W = U;
                        U = U.parentNode
                    }
                    U = this.endContainer;
                    if (U.nodeType == 1) {
                        if (W = U.childNodes[this.endOffset]) {
                            U.insertBefore(T, W)
                        } else {
                            U.appendChild(T)
                        }
                        W = U = T
                    } else {
                        W = U
                    }
                    while (1) {
                        if (w.isBlockElm(U)) {
                            U = W;
                            while ((W = U.nextSibling) && !w.isBlockElm(W)) {
                                U = W
                            }
                            this.setEndAfter(U);
                            break
                        }
                        W = U;
                        U = U.parentNode
                    }
                    if (T.parentNode === this.endContainer) {
                        this.endOffset--
                    }
                    w.remove(T)
                }
                if (!this.collapsed) {
                    while (this.startOffset == 0) {
                        if (V && V(this.startContainer)) {
                            break
                        }
                        if (R(this.startContainer)) {
                            break
                        }
                        this.setStartBefore(this.startContainer)
                    }
                    while (this.endOffset == (this.endContainer.nodeType == 1 ? this.endContainer.childNodes.length: this.endContainer.nodeValue.length)) {
                        if (V && V(this.endContainer)) {
                            break
                        }
                        if (R(this.endContainer)) {
                            break
                        }
                        this.setEndAfter(this.endContainer)
                    }
                }
                return this
            },
            adjustmentBoundary: function() {
                if (!this.collapsed) {
                    while (!w.isBody(this.startContainer) && this.startOffset == this.startContainer[this.startContainer.nodeType == 3 ? "nodeValue": "childNodes"].length && this.startContainer[this.startContainer.nodeType == 3 ? "nodeValue": "childNodes"].length) {
                        this.setStartAfter(this.startContainer)
                    }
                    while (!w.isBody(this.endContainer) && !this.endOffset && this.endContainer[this.endContainer.nodeType == 3 ? "nodeValue": "childNodes"].length) {
                        this.setEndBefore(this.endContainer)
                    }
                }
                return this
            },
            applyInlineStyle: function(T, ae, aa) {
                if (this.collapsed) {
                    return this
                }
                this.trimBoundary().enlarge(false,
                function(ai) {
                    return ai.nodeType == 1 && w.isBlockElm(ai)
                }).adjustmentBoundary();
                var ab = this.createBookmark(),
                W = ab.end,
                ag = function(ai) {
                    return ai.nodeType == 1 ? ai.tagName.toLowerCase() != "br": !w.isWhitespace(ai)
                },
                Z = w.getNextDomNode(ab.start, false, ag),
                U,
                V,
                Y = this.cloneRange();
                while (Z && (w.getPosition(Z, W) & w.POSITION_PRECEDING)) {
                    if (Z.nodeType == 3 || u[T][Z.tagName]) {
                        Y.setStartBefore(Z);
                        U = Z;
                        while (U && (U.nodeType == 3 || u[T][U.tagName]) && U !== W) {
                            V = U;
                            U = w.getNextDomNode(U, U.nodeType == 1, null,
                            function(ai) {
                                return u[T][ai.tagName]
                            })
                        }
                        var af = Y.setEndAfter(V).extractContents(),
                        ac;
                        if (aa && aa.length > 0) {
                            var R, ad;
                            ad = R = aa[0].cloneNode(false);
                            for (var X = 1,
                            ah; ah = aa[X++];) {
                                R.appendChild(ah.cloneNode(false));
                                R = R.firstChild
                            }
                            ac = R
                        } else {
                            ac = Y.document.createElement(T)
                        }
                        if (ae) {
                            w.setAttributes(ac, ae)
                        }
                        ac.appendChild(af);
                        Y.insertNode(aa ? ad: ac);
                        var S;
                        if (T == "span" && ae.style && /text\-decoration/.test(ae.style) && (S = w.findParentByTagName(ac, "a", true))) {
                            w.setAttributes(S, ae);
                            w.remove(ac, true);
                            ac = S
                        } else {
                            w.mergeSibling(ac);
                            w.clearEmptySibling(ac)
                        }
                        w.mergeChild(ac, ae);
                        Z = w.getNextDomNode(ac, false, ag);
                        w.mergeToParent(ac);
                        if (U === W) {
                            break
                        }
                    } else {
                        Z = w.getNextDomNode(Z, true, ag)
                    }
                }
                return this.moveToBookmark(ab)
            },
            removeInlineStyle: function(R) {
                if (this.collapsed) {
                    return this
                }
                R = C.isArray(R) ? R: [R];
                this.shrinkBoundary().adjustmentBoundary();
                var Y = this.startContainer,
                S = this.endContainer;
                while (1) {
                    if (Y.nodeType == 1) {
                        if (C.indexOf(R, Y.tagName.toLowerCase()) > -1) {
                            break
                        }
                        if (Y.tagName.toLowerCase() == "body") {
                            Y = null;
                            break
                        }
                    }
                    Y = Y.parentNode
                }
                while (1) {
                    if (S.nodeType == 1) {
                        if (C.indexOf(R, S.tagName.toLowerCase()) > -1) {
                            break
                        }
                        if (S.tagName.toLowerCase() == "body") {
                            S = null;
                            break
                        }
                    }
                    S = S.parentNode
                }
                var U = this.createBookmark(),
                X,
                W;
                if (Y) {
                    W = this.cloneRange().setEndBefore(U.start).setStartBefore(Y);
                    X = W.extractContents();
                    W.insertNode(X);
                    w.clearEmptySibling(Y, true);
                    Y.parentNode.insertBefore(U.start, Y)
                }
                if (S) {
                    W = this.cloneRange().setStartAfter(U.end).setEndAfter(S);
                    X = W.extractContents();
                    W.insertNode(X);
                    w.clearEmptySibling(S, false, true);
                    S.parentNode.insertBefore(U.end, S.nextSibling)
                }
                var V = w.getNextDomNode(U.start, false,
                function(Z) {
                    return Z.nodeType == 1
                }),
                T;
                while (V && V !== U.end) {
                    T = w.getNextDomNode(V, true,
                    function(Z) {
                        return Z.nodeType == 1
                    });
                    if (C.indexOf(R, V.tagName.toLowerCase()) > -1) {
                        w.remove(V, true)
                    }
                    V = T
                }
                return this.moveToBookmark(U)
            },
            getClosedNode: function() {
                var S;
                if (!this.collapsed) {
                    var R = this.cloneRange().adjustmentBoundary().shrinkBoundary();
                    if (Q(R)) {
                        var T = R.startContainer.childNodes[R.startOffset];
                        if (T && T.nodeType == 1 && (u.$empty[T.tagName] || u.$nonChild[T.tagName])) {
                            S = T
                        }
                    }
                }
                return S
            },
            select: E.ie ?
            function(S, ab) {
                var X;
                if (!this.collapsed) {
                    this.shrinkBoundary()
                }
                var T = this.getClosedNode();
                if (T && !ab) {
                    try {
                        X = this.document.body.createControlRange();
                        X.addElement(T);
                        X.select()
                    } catch(Y) {}
                    return this
                }
                var Z = this.createBookmark(),
                R = Z.start,
                U;
                X = this.document.body.createTextRange();
                X.moveToElementText(R);
                X.moveStart("character", 1);
                if (!this.collapsed) {
                    var W = this.document.body.createTextRange();
                    U = Z.end;
                    W.moveToElementText(U);
                    X.setEndPoint("EndToEnd", W)
                } else {
                    if (!S && this.startContainer.nodeType != 3) {
                        var aa = this.document.createTextNode(N),
                        V = this.document.createElement("span");
                        V.appendChild(this.document.createTextNode(N));
                        R.parentNode.insertBefore(V, R);
                        R.parentNode.insertBefore(aa, R);
                        L(this.document, aa);
                        J = aa;
                        O(V, "previousSibling");
                        O(R, "nextSibling");
                        X.moveStart("character", -1);
                        X.collapse(true)
                    }
                }
                this.moveToBookmark(Z);
                V && w.remove(V);
                try {
                    X.select()
                } catch(Y) {}
                return this
            }: function(R) {
                function S(aa) {
                    function Z(ac, ad, ab) {
                        if (ac.nodeType == 3 && ac.nodeValue.length < ad) {
                            aa[ab + "Offset"] = ac.nodeValue.length
                        }
                    }
                    Z(aa.startContainer, aa.startOffset, "start");
                    Z(aa.endContainer, aa.endOffset, "end")
                }
                var W = w.getWindow(this.document),
                V = W.getSelection(),
                U;
                E.gecko ? this.document.body.focus() : W.focus();
                if (V) {
                    V.removeAllRanges();
                    if (this.collapsed && !R) {
                        var Y = this.startContainer,
                        X = Y;
                        if (Y.nodeType == 1) {
                            X = Y.childNodes[this.startOffset]
                        }
                        if (! (Y.nodeType == 3 && this.startOffset) && (X ? (!X.previousSibling || X.previousSibling.nodeType != 3) : (!Y.lastChild || Y.lastChild.nodeType != 3))) {
                            U = this.document.createTextNode(N);
                            this.insertNode(U);
                            L(this.document, U);
                            O(U, "previousSibling");
                            O(U, "nextSibling");
                            J = U;
                            this.setStart(U, E.webkit ? 1 : 0).collapse(true)
                        }
                    }
                    var T = this.document.createRange();
                    if (this.collapsed && E.opera && this.startContainer.nodeType == 1) {
                        var X = this.startContainer.childNodes[this.startOffset];
                        if (!X) {
                            X = this.startContainer.lastChild;
                            if (X && w.isBr(X)) {
                                this.setStartBefore(X).collapse(true)
                            }
                        } else {
                            while (X && w.isBlockElm(X)) {
                                if (X.nodeType == 1 && X.childNodes[0]) {
                                    X = X.childNodes[0]
                                } else {
                                    break
                                }
                            }
                            X && this.setStartBefore(X).collapse(true)
                        }
                    }
                    S(this);
                    T.setStart(this.startContainer, this.startOffset);
                    T.setEnd(this.endContainer, this.endOffset);
                    V.addRange(T)
                }
                return this
            },
            scrollToView: function(T, U) {
                T = T ? window: w.getWindow(this.document);
                var S = this,
                R = S.document.createElement("span");
                R.innerHTML = "&nbsp;";
                S.cloneRange().insertNode(R);
                w.scrollToView(R, T, U);
                w.remove(R);
                return S
            },
            inFillChar: function() {
                var R = this.startContainer;
                if (this.collapsed && R.nodeType == 3 && R.nodeValue.replace(new RegExp("^" + w.fillChar), "").length + 1 == R.nodeValue.length) {
                    return true
                }
                return false
            },
            createAddress: function(U, T) {
                var V = {},
                S = this;
                function R(W) {
                    var Y = W ? S.startContainer: S.endContainer;
                    var ad = w.findParents(Y, true,
                    function(af) {
                        return ! w.isBody(af)
                    }),
                    ac = [];
                    for (var aa = 0,
                    ae; ae = ad[aa++];) {
                        ac.push(w.getNodeIndex(ae, T))
                    }
                    var X = 0;
                    if (T) {
                        if (Y.nodeType == 3) {
                            var Z = Y.previousSibling;
                            while (Z && Z.nodeType == 3) {
                                X += Z.nodeValue.replace(x, "").length;
                                Z = Z.previousSibling
                            }
                            X += (W ? S.startOffset: S.endOffset)
                        } else {
                            Y = Y.childNodes[W ? S.startOffset: S.endOffset];
                            if (Y) {
                                X = w.getNodeIndex(Y, T)
                            } else {
                                Y = W ? S.startContainer: S.endContainer;
                                var ab = Y.firstChild;
                                while (ab) {
                                    if (w.isFillChar(ab)) {
                                        ab = ab.nextSibling;
                                        continue
                                    }
                                    X++;
                                    if (ab.nodeType == 3) {
                                        while (ab && ab.nodeType == 3) {
                                            ab = ab.nextSibling
                                        }
                                    } else {
                                        ab = ab.nextSibling
                                    }
                                }
                            }
                        }
                    } else {
                        X = W ? w.isFillChar(Y) ? 0 : S.startOffset: S.endOffset
                    }
                    if (X < 0) {
                        X = 0
                    }
                    ac.push(X);
                    return ac
                }
                V.startAddress = R(true);
                if (!U) {
                    V.endAddress = S.collapsed ? [].concat(V.startAddress) : R()
                }
                return V
            },
            moveToAddress: function(U, S) {
                var R = this;
                function T(Y, X) {
                    var ab = R.document.body,
                    V, ac;
                    for (var aa = 0,
                    Z, W = Y.length; aa < W; aa++) {
                        Z = Y[aa];
                        V = ab;
                        ab = ab.childNodes[Z];
                        if (!ab) {
                            ac = Z;
                            break
                        }
                    }
                    if (X) {
                        if (ab) {
                            R.setStartBefore(ab)
                        } else {
                            R.setStart(V, ac)
                        }
                    } else {
                        if (ab) {
                            R.setEndBefore(ab)
                        } else {
                            R.setEnd(V, ac)
                        }
                    }
                }
                T(U.startAddress, true); ! S && U.endAddress && T(U.endAddress);
                return R
            },
            equals: function(R) {
                for (var S in this) {
                    if (this.hasOwnProperty(S)) {
                        if (this[S] !== R[S]) {
                            return false
                        }
                    }
                }
                return true
            },
            traversal: function(R, W) {
                if (this.collapsed) {
                    return this
                }
                var U = this.createBookmark(),
                S = U.end,
                V = w.getNextDomNode(U.start, false, W);
                while (V && V !== S && (w.getPosition(V, S) & w.POSITION_PRECEDING)) {
                    var T = w.getNextDomNode(V, false, W);
                    R(V);
                    V = T
                }
                return this.moveToBookmark(U)
            }
        }
    })(); (function() {
        function K(U, M) {
            var N = w.getNodeIndex;
            U = U.duplicate();
            U.collapse(M);
            var Y = U.parentElement();
            if (!Y.hasChildNodes()) {
                return {
                    container: Y,
                    offset: 0
                }
            }
            var X = Y.children,
            O, Q = U.duplicate(),
            Z = 0,
            T = X.length - 1,
            V = -1,
            L;
            while (Z <= T) {
                V = Math.floor((Z + T) / 2);
                O = X[V];
                Q.moveToElementText(O);
                var S = Q.compareEndPoints("StartToStart", U);
                if (S > 0) {
                    T = V - 1
                } else {
                    if (S < 0) {
                        Z = V + 1
                    } else {
                        return {
                            container: Y,
                            offset: N(O)
                        }
                    }
                }
            }
            if (V == -1) {
                Q.moveToElementText(Y);
                Q.setEndPoint("StartToStart", U);
                L = Q.text.replace(/(\r\n|\r)/g, "\n").length;
                X = Y.childNodes;
                if (!L) {
                    O = X[X.length - 1];
                    return {
                        container: O,
                        offset: O.nodeValue.length
                    }
                }
                var R = X.length;
                while (L > 0) {
                    L -= X[--R].nodeValue.length
                }
                return {
                    container: X[R],
                    offset: -L
                }
            }
            Q.collapse(S > 0);
            Q.setEndPoint(S > 0 ? "StartToStart": "EndToStart", U);
            L = Q.text.replace(/(\r\n|\r)/g, "\n").length;
            if (!L) {
                return u.$empty[O.tagName] || u.$nonChild[O.tagName] ? {
                    container: Y,
                    offset: N(O) + (S > 0 ? 0 : 1)
                }: {
                    container: O,
                    offset: S > 0 ? 0 : O.childNodes.length
                }
            }
            while (L > 0) {
                try {
                    var P = O;
                    O = O[S > 0 ? "previousSibling": "nextSibling"];
                    L -= O.nodeValue.length
                } catch(W) {
                    return {
                        container: Y,
                        offset: N(P)
                    }
                }
            }
            return {
                container: O,
                offset: S > 0 ? -L: O.nodeValue.length + L
            }
        }
        function J(N, M) {
            if (N.item) {
                M.selectNode(N.item(0))
            } else {
                var L = K(N, true);
                M.setStart(L.container, L.offset);
                if (N.compareEndPoints("StartToEnd", N) != 0) {
                    L = K(N, false);
                    M.setEnd(L.container, L.offset)
                }
            }
            return M
        }
        function I(N) {
            var M;
            try {
                M = N.getNative().createRange()
            } catch(O) {
                return null
            }
            var L = M.item ? M.item(0) : M.parentElement();
            if ((L.ownerDocument || L) === N.document) {
                return M
            }
            return null
        }
        var H = y.Selection = function(N) {
            var M = this,
            L;
            M.document = N;
            if (t) {
                L = w.getWindow(N).frameElement;
                w.on(L, "beforedeactivate",
                function() {
                    M._bakIERange = M.getIERange()
                });
                w.on(L, "activate",
                function() {
                    try {
                        if (!I(M) && M._bakIERange) {
                            M._bakIERange.select()
                        }
                    } catch(O) {}
                    M._bakIERange = null
                })
            }
            L = N = null
        };
        H.prototype = {
            getNative: function() {
                var M = this.document;
                try {
                    return ! M ? null: t ? M.selection: w.getWindow(M).getSelection()
                } catch(L) {
                    return null
                }
            },
            getIERange: function() {
                var L = I(this);
                if (!L) {
                    if (this._bakIERange) {
                        return this._bakIERange
                    }
                }
                return L
            },
            cache: function() {
                this.clear();
                this._cachedRange = this.getRange();
                this._cachedStartElement = this.getStart();
                this._cachedStartElementPath = this.getStartElementPath()
            },
            getStartElementPath: function() {
                if (this._cachedStartElementPath) {
                    return this._cachedStartElementPath
                }
                var L = this.getStart();
                if (L) {
                    return w.findParents(L, true, null, true)
                }
                return []
            },
            clear: function() {
                this._cachedStartElementPath = this._cachedRange = this._cachedStartElement = null
            },
            isFocus: function() {
                try {
                    return E.ie && I(this) || !E.ie && this.getNative().rangeCount ? true: false
                } catch(L) {
                    return false
                }
            },
            getRange: function() {
                var O = this;
                function N(T) {
                    var V = O.document.body.firstChild,
                    U = T.collapsed;
                    while (V && V.firstChild) {
                        T.setStart(V, 0);
                        V = V.firstChild
                    }
                    if (!T.startContainer) {
                        T.setStart(O.document.body, 0)
                    }
                    if (U) {
                        T.collapse(true)
                    }
                }
                if (O._cachedRange != null) {
                    return this._cachedRange
                }
                var M = new s.editor.dom.Range(O.document);
                if (t) {
                    var Q = O.getIERange();
                    if (Q) {
                        try {
                            J(Q, M)
                        } catch(R) {
                            N(M)
                        }
                    } else {
                        N(M)
                    }
                } else {
                    var P = O.getNative();
                    if (P && P.rangeCount) {
                        var L = P.getRangeAt(0);
                        var S = P.getRangeAt(P.rangeCount - 1);
                        M.setStart(L.startContainer, L.startOffset).setEnd(S.endContainer, S.endOffset);
                        if (M.collapsed && w.isBody(M.startContainer) && !M.startOffset) {
                            N(M)
                        }
                    } else {
                        if (this._bakRange && w.inDoc(this._bakRange.startContainer, this.document)) {
                            return this._bakRange
                        }
                        N(M)
                    }
                }
                return this._bakRange = M
            },
            getStart: function() {
                if (this._cachedStartElement) {
                    return this._cachedStartElement
                }
                var L = t ? this.getIERange() : this.getRange(),
                O,
                P,
                M,
                N;
                if (t) {
                    if (!L) {
                        return this.document.body.firstChild
                    }
                    if (L.item) {
                        return L.item(0)
                    }
                    O = L.duplicate();
                    O.text.length > 0 && O.moveStart("character", 1);
                    O.collapse(1);
                    P = O.parentElement();
                    N = M = L.parentElement();
                    while (M = M.parentNode) {
                        if (M == P) {
                            P = N;
                            break
                        }
                    }
                } else {
                    L.shrinkBoundary();
                    P = L.startContainer;
                    if (P.nodeType == 1 && P.hasChildNodes()) {
                        P = P.childNodes[Math.min(P.childNodes.length - 1, L.startOffset)]
                    }
                    if (P.nodeType == 3) {
                        return P.parentNode
                    }
                }
                return P
            },
            getText: function() {
                var L, M;
                if (this.isFocus() && (L = this.getNative())) {
                    M = E.ie ? L.createRange() : L.getRangeAt(0);
                    return E.ie ? M.text: M.toString()
                }
                return ""
            },
            clearRange: function() {
                this.getNative()[E.ie ? "empty": "removeAllRanges"]()
            }
        }
    })(); (function() {
        var J = 0,
        I;
        function K(Q, P) {
            var L;
            if (P.textarea) {
                if (C.isString(P.textarea)) {
                    for (var N = 0,
                    O, M = w.getElementsByTagName(Q, "textarea"); O = M[N++];) {
                        if (O.id == "ueditor_textarea_" + P.options.textarea) {
                            L = O;
                            break
                        }
                    }
                } else {
                    L = P.textarea
                }
            }
            if (!L) {
                Q.appendChild(L = w.createElement(document, "textarea", {
                    name: P.options.textarea,
                    id: "ueditor_textarea_" + P.options.textarea,
                    style: "display:none"
                }));
                P.textarea = L
            }
            L.value = P.hasContents() ? (P.options.allHtmlEnabled ? P.getAllHtml() : P.getContent(null, null, true)) : ""
        }
        var H = UE.Editor = function(L) {
            var M = this;
            M.uid = J++;
            f.call(M);
            M.commands = {};
            M.options = C.extend(C.clone(L || {}), UEDITOR_CONFIG, true);
            M.shortcutkeys = {};
            M.inputRules = [];
            M.outputRules = [];
            M.setOpt({
                isShow: true,
                initialContent: "",
                initialStyle: "",
                autoClearinitialContent: false,
                iframeCssUrl: M.options.UEDITOR_HOME_URL + "themes/iframe.css",
                textarea: "editorValue",
                focus: false,
                focusInEnd: true,
                autoClearEmptyNode: true,
                fullscreen: false,
                readonly: false,
                zIndex: 999,
                imagePopup: true,
                enterTag: "p",
                customDomain: false,
                lang: "zh-cn",
                langPath: M.options.UEDITOR_HOME_URL + "lang/",
                theme: "default",
                themePath: M.options.UEDITOR_HOME_URL + "themes/",
                allHtmlEnabled: false,
                scaleEnabled: false,
                tableNativeEditInFF: false,
                autoSyncData: true
            });
            UE.instants["ueditorInstant" + M.uid] = M;
            if (M.options.langPath !== null) {
                C.loadFile(document, {
                    src: M.options.langPath + M.options.lang + "/" + M.options.lang + ".js",
                    tag: "script",
                    type: "text/javascript",
                    defer: "defer"
                },
                N)
            } else {
                N()
            }
            function N() {
                for (var O in UE.plugins) {
                    UE.plugins[O].call(M)
                }
                M.langIsReady = true;
                M.fireEvent("langReady")
            }
        };
        H.prototype = {
            ready: function(L) {
                var M = this;
                if (L) {
                    M.isReady ? L.apply(M) : M.addListener("ready", L)
                }
            },
            setOpt: function(L, N) {
                var M = {};
                if (C.isString(L)) {
                    M[L] = N
                } else {
                    M = L
                }
                C.extend(this.options, M, true)
            },
            destroy: function() {
                var O = this;
                O.fireEvent("destroy");
                var M = O.container.parentNode;
                var L = O.textarea;
                if (!L) {
                    L = document.createElement("textarea");
                    M.parentNode.insertBefore(L, M)
                } else {
                    L.style.display = ""
                }
                L.style.width = O.iframe.offsetWidth + "px";
                L.style.height = O.iframe.offsetHeight + "px";
                L.value = O.getContent();
                L.id = O.key;
                M.innerHTML = "";
                w.remove(M);
                var N = O.key;
                for (var P in O) {
                    if (O.hasOwnProperty(P)) {
                        delete this[P]
                    }
                }
                UE.delEditor(N)
            },
            render: function(M, P) {
                var Q = this,
                N = Q.options;
                if (C.isString(M)) {
                    M = document.getElementById(M)
                }
                if (M) {
                    var L = t && E.version < 9,
                    O = (t && E.version < 9 ? "": "<!DOCTYPE html>") + "<html xmlns='http://www.w3.org/1999/xhtml'" + (!L ? " class='view'": "") + "><head>" + (N.iframeCssUrl ? "<link rel='stylesheet' type='text/css' href='" + C.unhtml(N.iframeCssUrl) + "'/>": "") + "<style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:100%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}" + (N.initialStyle || "") + "</style></head><body" + (L ? " class='view'": "") + "></body>";
                    if (N.customDomain && document.domain != location.hostname) {
                        O += "<script>window.parent.UE.instants['ueditorInstant" + Q.uid + "']._setup(document);<\/script></html>";
                        M.appendChild(w.createElement(document, "iframe", {
                            id: "ueditor_" + Q.uid,
                            width: "100%",
                            height: "100%",
                            frameborder: "0",
                            src: 'javascript:void(function(){document.open();document.domain="' + document.domain + '";document.write("' + O + '");document.close();}())'
                        }))
                    } else {
                        if (N.initialFrameWidth) {
                            N.minFrameWidth = N.initialFrameWidth
                        } else {
                            N.minFrameWidth = N.initialFrameWidth = M.offsetWidth
                        }
                        if (N.initialFrameHeight) {
                            N.minFrameHeight = N.initialFrameHeight
                        } else {
                            N.initialFrameHeight = N.minFrameHeight = M.offsetHeight
                        }
                        M.style.width = N.initialFrameWidth + "px";
                        M.style.height = N.initialFrameHeight + "px";
                        M.style.zIndex = N.zIndex;
                        M.innerHTML = '<iframe id="ueditor_' + this.uid + '"width="100%" height="100%" scroll="no" frameborder="0" ></iframe>';
                        var R = M.firstChild.contentWindow.document;
                        R.open();
                        R.write(O + "</html>");
                        R.close();
                        Q._setup(R)
                    }
                    M.style.overflow = "hidden"
                }
            },
            _setup: function(Q) {
                var O = this,
                L = O.options;
                if (t) {
                    Q.body.disabled = true;
                    Q.body.contentEditable = true;
                    Q.body.disabled = false
                } else {
                    Q.body.contentEditable = true;
                    Q.body.spellcheck = false
                }
                O.document = Q;
                O.window = Q.defaultView || Q.parentWindow;
                O.iframe = O.window.frameElement;
                O.body = Q.body;
                O.selection = new y.Selection(Q);
                var R;
                if (E.gecko && (R = this.selection.getNative())) {
                    R.removeAllRanges()
                }
                this._initEvents();
                for (var N = this.iframe.parentNode; ! w.isBody(N); N = N.parentNode) {
                    if (N.tagName == "FORM") {
                        O.form = N;
                        if (O.options.autoSyncData) {
                            w.on(O.window, "blur",
                            function() {
                                K(N, O)
                            })
                        } else {
                            w.on(N, "submit",
                            function() {
                                K(this, O)
                            })
                        }
                        break
                    }
                }
                if (L.initialContent) {
                    if (L.autoClearinitialContent) {
                        var M = O.execCommand;
                        O.execCommand = function() {
                            O.fireEvent("firstBeforeExecCommand");
                            return M.apply(O, arguments)
                        };
                        this._setDefaultContent(L.initialContent)
                    } else {
                        this.setContent(L.initialContent, false, true)
                    }
                }
                if (w.isEmptyNode(O.body)) {
                    O.body.innerHTML = "<p>" + (E.ie ? "": "<br/>") + "</p>"
                }
                if (L.focus) {
                    setTimeout(function() {
                        O.focus(O.options.focusInEnd); ! O.options.autoClearinitialContent && O._selectionChange()
                    },
                    0)
                }
                if (!O.container) {
                    O.container = this.iframe.parentNode
                }
                if (L.fullscreen && O.ui) {
                    O.ui.setFullScreen(true)
                }
                try {
                    O.document.execCommand("2D-position", false, false)
                } catch(P) {}
                try {
                    O.document.execCommand("enableInlineTableEditing", false, false)
                } catch(P) {}
                try {
                    O.document.execCommand("enableObjectResizing", false, false)
                } catch(P) {}
                O._bindshortcutKeys();
                O.isReady = 1;
                O.fireEvent("ready");
                L.onready && L.onready.call(O);
                if (!E.ie) {
                    w.on(O.window, ["blur", "focus"],
                    function(S) {
                        if (S.type == "blur") {
                            O._bakRange = O.selection.getRange();
                            try {
                                O.selection.getNative().removeAllRanges()
                            } catch(S) {}
                        } else {
                            try {
                                O._bakRange && O._bakRange.select()
                            } catch(S) {}
                        }
                    })
                }
                if (E.gecko && E.version <= 10902) {
                    O.body.contentEditable = false;
                    setTimeout(function() {
                        O.body.contentEditable = true
                    },
                    100);
                    setInterval(function() {
                        O.body.style.height = O.iframe.offsetHeight - 20 + "px"
                    },
                    100)
                } ! L.isShow && O.setHide();
                L.readonly && O.setDisabled()
            },
            sync: function(N) {
                var M = this,
                L = N ? document.getElementById(N) : w.findParent(M.iframe.parentNode,
                function(O) {
                    return O.tagName == "FORM"
                },
                true);
                L && K(L, M)
            },
            setHeight: function(L) {
                if (L !== parseInt(this.iframe.parentNode.style.height)) {
                    this.iframe.parentNode.style.height = L + "px"
                }
                this.document.body.style.height = L - 20 + "px"
            },
            addshortcutkey: function(M, L) {
                var N = {};
                if (L) {
                    N[M] = L
                } else {
                    N = M
                }
                C.extend(this.shortcutkeys, N)
            },
            _bindshortcutKeys: function() {
                var M = this,
                L = this.shortcutkeys;
                M.addListener("keydown",
                function(S, R) {
                    var U = R.keyCode || R.which;
                    for (var P in L) {
                        var Q = L[P].split(",");
                        for (var V = 0,
                        N; N = Q[V++];) {
                            N = N.split(":");
                            var T = N[0],
                            O = N[1];
                            if (/^(ctrl)(\+shift)?\+(\d+)$/.test(T.toLowerCase()) || /^(\d+)$/.test(T)) {
                                if (((RegExp.$1 == "ctrl" ? (R.ctrlKey || R.metaKey) : 0) && (RegExp.$2 != "" ? R[RegExp.$2.slice(1) + "Key"] : 1) && U == RegExp.$3) || U == RegExp.$1) {
                                    if (M.queryCommandState(P, O) != -1) {
                                        M.execCommand(P, O)
                                    }
                                    w.preventDefault(R)
                                }
                            }
                        }
                    }
                })
            },
            getContent: function(R, P, M, O, N) {
                var Q = this;
                if (R && C.isFunction(R)) {
                    P = R;
                    R = ""
                }
                if (P ? !P() : !this.hasContents()) {
                    return ""
                }
                Q.fireEvent("beforegetcontent");
                var L = UE.htmlparser(Q.body.innerHTML, O);
                Q.filterOutputRule(L);
                Q.fireEvent("aftergetcontent", R);
                return L.toHtml(N)
            },
            getAllHtml: function() {
                var N = this,
                M = [],
                L = "";
                N.fireEvent("getAllHtml", M);
                if (E.ie && E.version > 8) {
                    var O = "";
                    C.each(N.document.styleSheets,
                    function(P) {
                        O += (P.href ? '<link rel="stylesheet" type="text/css" href="' + P.href + '" />': "<style>" + P.cssText + "</style>")
                    });
                    C.each(N.document.getElementsByTagName("script"),
                    function(P) {
                        O += P.outerHTML
                    })
                }
                return "<html><head>" + (N.options.charset ? '<meta http-equiv="Content-Type" content="text/html; charset=' + N.options.charset + '"/>': "") + (O || N.document.getElementsByTagName("head")[0].innerHTML) + M.join("\n") + "</head><body " + (t && E.version < 9 ? 'class="view"': "") + ">" + N.getContent(null, null, true) + "</body></html>"
            },
            getPlainTxt: function() {
                var M = new RegExp(w.fillChar, "g"),
                L = this.body.innerHTML.replace(/[\n\r]/g, "");
                L = L.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi, "\n").replace(/<br\/?>/gi, "\n").replace(/<[^>/] + >/g,"").replace(/ (\n) ? <\ / ([ ^ >] + ) > /g,function(O,N,P){return u.$block[P]?"\n":N?N:""});return L.replace(M,"").replace(/\u00a0 / g,
                " ").replace(/&nbsp;/g, " ")
            },
            getContentTxt: function() {
                var L = new RegExp(w.fillChar, "g");
                return this.body[E.ie ? "innerText": "textContent"].replace(L, "").replace(/\u00a0/g, " ")
            },
            setContent: function(P, S, O) {
                var T = this;
                if (/<\s*\/\s*pre\s*>$/.test(C.trim(P))) {
                    P += "<p>&nbsp;</p>"
                }
                T.fireEvent("beforesetcontent", P);
                var U = UE.htmlparser(P);
                T.filterInputRule(U);
                P = U.toHtml();
                T.body.innerHTML = (S ? T.body.innerHTML: "") + P;
                function R(V) {
                    return V.tagName == "DIV" && V.getAttribute("cdata_tag")
                }
                if (T.options.enterTag == "p") {
                    var M = this.body.firstChild,
                    N;
                    if (!M || M.nodeType == 1 && (u.$cdata[M.tagName] || R(M) || w.isCustomeNode(M)) && M === this.body.lastChild) {
                        this.body.innerHTML = "<p>" + (E.ie ? "&nbsp;": "<br/>") + "</p>" + this.body.innerHTML
                    } else {
                        var L = T.document.createElement("p");
                        while (M) {
                            while (M && (M.nodeType == 3 || M.nodeType == 1 && u.p[M.tagName] && !u.$cdata[M.tagName])) {
                                N = M.nextSibling;
                                L.appendChild(M);
                                M = N
                            }
                            if (L.firstChild) {
                                if (!M) {
                                    T.body.appendChild(L);
                                    break
                                } else {
                                    M.parentNode.insertBefore(L, M);
                                    L = T.document.createElement("p")
                                }
                            }
                            M = M.nextSibling
                        }
                    }
                }
                T.fireEvent("aftersetcontent");
                T.fireEvent("contentchange"); ! O && T._selectionChange();
                T._bakRange = T._bakIERange = null;
                var Q;
                if (E.gecko && (Q = this.selection.getNative())) {
                    Q.removeAllRanges()
                }
                if (T.options.autoSyncData) {
                    T.form && K(T.form, T)
                }
            },
            focus: function(O) {
                try {
                    var M = this,
                    L = M.selection.getRange();
                    if (O) {
                        L.setStartAtLast(M.body.lastChild).setCursor(false, true)
                    } else {
                        L.select(true)
                    }
                    this.fireEvent("focus")
                } catch(N) {}
            },
            _initEvents: function() {
                var M = this,
                Q = M.document,
                P = M.window;
                M._proxyDomEvent = C.bind(M._proxyDomEvent, M);
                w.on(Q, ["click", "contextmenu", "mousedown", "keydown", "keyup", "keypress", "mouseup", "mouseover", "mouseout", "selectstart"], M._proxyDomEvent);
                w.on(P, ["focus", "blur"], M._proxyDomEvent);
                w.on(Q, ["mouseup", "keydown"],
                function(R) {
                    if (R.type == "keydown" && (R.ctrlKey || R.metaKey || R.shiftKey || R.altKey)) {
                        return
                    }
                    if (R.button == 2) {
                        return
                    }
                    M._selectionChange(250, R)
                });
                var L = 0,
                N = E.ie ? M.body: M.document,
                O;
                w.on(N, "dragstart",
                function() {
                    L = 1
                });
                w.on(N, E.webkit ? "dragover": "drop",
                function() {
                    return E.webkit ?
                    function() {
                        clearTimeout(O);
                        O = setTimeout(function() {
                            if (!L) {
                                var V = M.selection,
                                R = V.getRange();
                                if (R) {
                                    var S = R.getCommonAncestor();
                                    if (S && M.serialize) {
                                        var U = M.serialize,
                                        T = U.filter(U.transformInput(U.parseHTML(U.word(S.innerHTML))));
                                        S.innerHTML = U.toHTML(T)
                                    }
                                }
                            }
                            L = 0
                        },
                        200)
                    }: function(R) {
                        if (!L) {
                            R.preventDefault ? R.preventDefault() : (R.returnValue = false)
                        }
                        L = 0
                    }
                } ())
            },
            _proxyDomEvent: function(L) {
                return this.fireEvent(L.type.replace(/^on/, ""), L)
            },
            _selectionChange: function(O, L) {
                var R = this;
                var Q = false;
                var P, N;
                if (E.ie && E.version < 9 && L && L.type == "mouseup") {
                    var M = this.selection.getRange();
                    if (!M.collapsed) {
                        Q = true;
                        P = L.clientX;
                        N = L.clientY
                    }
                }
                clearTimeout(I);
                I = setTimeout(function() {
                    if (!R.selection.getNative()) {
                        return
                    }
                    var T;
                    if (Q && R.selection.getNative().type == "None") {
                        T = R.document.body.createTextRange();
                        try {
                            T.moveToPoint(P, N)
                        } catch(S) {
                            T = null
                        }
                    }
                    var U;
                    if (T) {
                        U = R.selection.getIERange;
                        R.selection.getIERange = function() {
                            return T
                        }
                    }
                    R.selection.cache();
                    if (U) {
                        R.selection.getIERange = U
                    }
                    if (R.selection._cachedRange && R.selection._cachedStartElement) {
                        R.fireEvent("beforeselectionchange");
                        R.fireEvent("selectionchange", !!L);
                        R.fireEvent("afterselectionchange");
                        R.selection.clear()
                    }
                },
                O || 50)
            },
            _callCmdFn: function(P, M) {
                var L = M[0].toLowerCase(),
                O,
                N;
                O = this.commands[L] || UE.commands[L];
                N = O && O[P];
                if ((!O || !N) && P == "queryCommandState") {
                    return 0
                } else {
                    if (N) {
                        return N.apply(this, M)
                    }
                }
            },
            execCommand: function(M) {
                M = M.toLowerCase();
                var N = this,
                L, O = N.commands[M] || UE.commands[M];
                if (!O || !O.execCommand) {
                    return null
                }
                if (!O.notNeedUndo && !N.__hasEnterExecCommand) {
                    N.__hasEnterExecCommand = true;
                    if (N.queryCommandState.apply(N, arguments) != -1) {
                        N.fireEvent("beforeexeccommand", M);
                        L = this._callCmdFn("execCommand", arguments); ! N._ignoreContentChange && N.fireEvent("contentchange");
                        N.fireEvent("afterexeccommand", M)
                    }
                    N.__hasEnterExecCommand = false
                } else {
                    L = this._callCmdFn("execCommand", arguments); ! N._ignoreContentChange && N.fireEvent("contentchange")
                } ! N._ignoreContentChange && N._selectionChange();
                return L
            },
            queryCommandState: function(L) {
                return this._callCmdFn("queryCommandState", arguments)
            },
            queryCommandValue: function(L) {
                return this._callCmdFn("queryCommandValue", arguments)
            },
            hasContents: function(M) {
                if (M) {
                    for (var O = 0,
                    N; N = M[O++];) {
                        if (this.document.getElementsByTagName(N).length > 0) {
                            return true
                        }
                    }
                }
                if (!w.isEmptyBlock(this.body)) {
                    return true
                }
                M = ["div"];
                for (O = 0; N = M[O++];) {
                    var L = w.getElementsByTagName(this.document, N);
                    for (var Q = 0,
                    P; P = L[Q++];) {
                        if (w.isCustomeNode(P)) {
                            return true
                        }
                    }
                }
                return false
            },
            reset: function() {
                this.fireEvent("reset")
            },
            setEnabled: function() {
                var M = this,
                L;
                if (M.body.contentEditable == "false") {
                    M.body.contentEditable = true;
                    L = M.selection.getRange();
                    try {
                        L.moveToBookmark(M.lastBk);
                        delete M.lastBk
                    } catch(N) {
                        L.setStartAtFirst(M.body).collapse(true)
                    }
                    L.select(true);
                    if (M.bkqueryCommandState) {
                        M.queryCommandState = M.bkqueryCommandState;
                        delete M.bkqueryCommandState
                    }
                    M.fireEvent("selectionchange")
                }
            },
            enable: function() {
                return this.setEnabled()
            },
            setDisabled: function(L) {
                var M = this;
                L = L ? C.isArray(L) ? L: [L] : [];
                if (M.body.contentEditable == "true") {
                    if (!M.lastBk) {
                        M.lastBk = M.selection.getRange().createBookmark(true)
                    }
                    M.body.contentEditable = false;
                    M.bkqueryCommandState = M.queryCommandState;
                    M.queryCommandState = function(N) {
                        if (C.indexOf(L, N) != -1) {
                            return M.bkqueryCommandState.apply(M, arguments)
                        }
                        return - 1
                    };
                    M.fireEvent("selectionchange")
                }
            },
            disable: function(L) {
                return this.setDisabled(L)
            },
            _setDefaultContent: function() {
                function L() {
                    var M = this;
                    if (M.document.getElementById("initContent")) {
                        M.body.innerHTML = "<p>" + (t ? "": "<br/>") + "</p>";
                        M.removeListener("firstBeforeExecCommand focus", L);
                        setTimeout(function() {
                            M.focus();
                            M._selectionChange()
                        },
                        0)
                    }
                }
                return function(M) {
                    var N = this;
                    N.body.innerHTML = '<p id="initContent">' + M + "</p>";
                    N.addListener("firstBeforeExecCommand focus", L)
                }
            } (),
            setShow: function() {
                var M = this,
                L = M.selection.getRange();
                if (M.container.style.display == "none") {
                    try {
                        L.moveToBookmark(M.lastBk);
                        delete M.lastBk
                    } catch(N) {
                        L.setStartAtFirst(M.body).collapse(true)
                    }
                    setTimeout(function() {
                        L.select(true)
                    },
                    100);
                    M.container.style.display = ""
                }
            },
            show: function() {
                return this.setShow()
            },
            setHide: function() {
                var L = this;
                if (!L.lastBk) {
                    L.lastBk = L.selection.getRange().createBookmark(true)
                }
                L.container.style.display = "none"
            },
            hide: function() {
                return this.setHide()
            },
            getLang: function(N) {
                var O = UE.I18N[this.options.lang];
                if (!O) {
                    throw Error("not import language file")
                }
                N = (N || "").split(".");
                for (var M = 0,
                L; L = N[M++];) {
                    O = O[L];
                    if (!O) {
                        break
                    }
                }
                return O
            },
            getContentLength: function(M, L) {
                var P = this.getContent(false, false, true).length;
                if (M) {
                    L = (L || []).concat(["hr", "img", "iframe"]);
                    P = this.getContentTxt().replace(/[\t\r\n]+/g, "").length;
                    for (var O = 0,
                    N; N = L[O++];) {
                        P += this.document.getElementsByTagName(N).length
                    }
                }
                return P
            },
            addInputRule: function(L) {
                this.inputRules.push(L)
            },
            filterInputRule: function(L) {
                for (var N = 0,
                M; M = this.inputRules[N++];) {
                    M.call(this, L)
                }
            },
            addOutputRule: function(L) {
                this.outputRules.push(L)
            },
            filterOutputRule: function(L) {
                for (var N = 0,
                M; M = this.outputRules[N++];) {
                    M.call(this, L)
                }
            }
        }; C.inherits(H, f)
    })();
    var D = UE.filterWord = function() {
        function J(K) {
            return /(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<v:)/ig.test(K)
        }
        function H(K) {
            K = K.replace(/[\d.]+\w+/g,
            function(L) {
                return C.transUnitToPx(L)
            });
            return K
        }
        function I(K) {
            return K.replace(/[\t\r\n]+/g, "").replace(/<!--[\s\S]*?-->/ig, "").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,
            function(P) {
                if (E.opera) {
                    return ""
                }
                try {
                    var M = P.match(/width:([ \d.]*p[tx])/i)[1],
                    L = P.match(/height:([ \d.]*p[tx])/i)[1],
                    O = P.match(/src=\s*"([^"]*)"/i)[1];
                    return '<img width="' + H(M) + '" height="' + H(L) + '" src="' + O + '" />'
                } catch(N) {
                    return ""
                }
            }).replace(/<\/?div[^>]*>/g, "").replace(/v:\w+=(["']?)[^'"]+\1/g, "").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi, "").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/ig,
            function(O, L, M, N) {
                return L == "class" && N == "MsoListParagraph" ? O: ""
            }).replace(/<(font|span)[^>]*>\s*<\/\1>/gi, "").replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,
            function(R, V, P, M) {
                var N = [],
                U = M.replace(/^\s+|\s+$/, "").replace(/&#39;/g, "'").replace(/&quot;/gi, "'").split(/;\s*/g);
                for (var Q = 0,
                T; T = U[Q]; Q++) {
                    var L, S, O = T.split(":");
                    if (O.length == 2) {
                        L = O[0].toLowerCase();
                        S = O[1].toLowerCase();
                        if (/^(background)\w*/.test(L) && S.replace(/(initial|\s)/g, "").length == 0 || /^(margin)\w*/.test(L) && /^0\w+$/.test(S)) {
                            continue
                        }
                        switch (L) {
                            case "mso-padding-alt":
                            case "mso-padding-top-alt":
                            case "mso-padding-right-alt":
                            case "mso-padding-bottom-alt":
                            case "mso-padding-left-alt":
                            case "mso-margin-alt":
                            case "mso-margin-top-alt":
                            case "mso-margin-right-alt":
                            case "mso-margin-bottom-alt":
                            case "mso-margin-left-alt":
                            case "mso-height":
                            case "mso-width":
                            case "mso-vertical-align-alt":
                                if (!/<table/.test(V)) {
                                    N[Q] = L.replace(/^mso-|-alt$/g, "") + ":" + H(S)
                                }
                                continue;
                            case "horiz-align":
                                N[Q] = "text-align:" + S;
                                continue;
                            case "vert-align":
                                N[Q] = "vertical-align:" + S;
                                continue;
                            case "font-color":
                            case "mso-foreground":
                                N[Q] = "color:" + S;
                                continue;
                            case "mso-background":
                            case "mso-highlight":
                                N[Q] = "background:" + S;
                                continue;
                            case "mso-default-height":
                                N[Q] = "min-height:" + H(S);
                                continue;
                            case "mso-default-width":
                                N[Q] = "min-width:" + H(S);
                                continue;
                            case "mso-padding-between-alt":
                                N[Q] = "border-collapse:separate;border-spacing:" + H(S);
                                continue;
                            case "text-line-through":
                                if ((S == "single") || (S == "double")) {
                                    N[Q] = "text-decoration:line-through"
                                }
                                continue;
                            case "mso-zero-height":
                                if (S == "yes") {
                                    N[Q] = "display:none"
                                }
                                continue;
                            case "background":
                                break;
                            case "margin":
                                if (!/[1-9]/.test(S)) {
                                    continue
                                }
                        }
                        if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(L) || /text\-indent|padding|margin/.test(L) && /\-[\d.]+/.test(S)) {
                            continue
                        }
                        N[Q] = L + ":" + O[1]
                    }
                }
                return V + (N.length ? ' style="' + N.join(";").replace(/;{2,}/g, ";") + '"': "")
            }).replace(/[\d.]+(cm|pt)/g,
            function(L) {
                return C.transUnitToPx(L)
            })
        }
        return function(K) {
            return (J(K) ? I(K) : K)
        }
    } (); (function() {
        var L = UE.uNode = function(T) {
            this.type = T.type;
            this.data = T.data;
            this.tagName = T.tagName;
            this.parentNode = T.parentNode;
            this.attrs = T.attrs || {};
            this.children = T.children
        };
        var P = "    ",
        O = "\n";
        function J(T, V, U) {
            T.push(O);
            return V + (U ? 1 : -1)
        }
        function S(T, V) {
            for (var U = 0; U < V; U++) {
                T.push(P)
            }
        }
        L.createElement = function(T) {
            if (/[<>]/.test(T)) {
                return UE.htmlparser(T).children[0]
            } else {
                return new L({
                    type: "element",
                    children: [],
                    tagName: T
                })
            }
        };
        L.createText = function(T) {
            return new UE.uNode({
                type: "text",
                data: C.unhtml(T || "")
            })
        };
        function Q(X, T, W, Y) {
            switch (X.type) {
                case "root":
                    for (var V = 0,
                    U; U = X.children[V++];) {
                        if (W && U.type == "element" && !u.$inlineWithA[U.tagName] && V > 1) {
                            J(T, Y, true);
                            S(T, Y)
                        }
                        Q(U, T, W, Y)
                    }
                    break;
                case "text":
                    M(X, T);
                    break;
                case "element":
                    N(X, T, W, Y);
                    break;
                case "comment":
                    R(X, T, W)
            }
            return T
        }
        function M(U, T) {
            T.push(U.parentNode.tagName == "pre" ? U.data: U.data.replace(/[ ]{2}/g, " &nbsp;"))
        }
        function N(T, V, Z, W) {
            var X = "";
            if (T.attrs) {
                X = [];
                var aa = T.attrs;
                for (var Y in aa) {
                    X.push(Y + (aa[Y] !== undefined ? '="' + C.unhtml(aa[Y]) + '"': ""))
                }
                X = X.join(" ")
            }
            V.push("<" + T.tagName + (X ? " " + X: "") + (u.$empty[T.tagName] ? "/": "") + ">");
            if (Z && !u.$inlineWithA[T.tagName] && T.tagName != "pre") {
                if (T.children && T.children.length) {
                    W = J(V, W, true);
                    S(V, W)
                }
            }
            if (T.children && T.children.length) {
                for (var U = 0,
                ab; ab = T.children[U++];) {
                    if (Z && ab.type == "element" && !u.$inlineWithA[ab.tagName] && U > 1) {
                        J(V, W);
                        S(V, W)
                    }
                    Q(ab, V, Z, W)
                }
            }
            if (!u.$empty[T.tagName]) {
                if (Z && !u.$inlineWithA[T.tagName] && T.tagName != "pre") {
                    if (T.children && T.children.length) {
                        W = J(V, W);
                        S(V, W)
                    }
                }
                V.push("</" + T.tagName + ">")
            }
        }
        function R(U, T) {
            T.push("<!--" + U.data + "-->")
        }
        function K(T, X) {
            var W;
            if (T.type == "element" && T.getAttr("id") == X) {
                return T
            }
            if (T.children && T.children.length) {
                for (var V = 0,
                U; U = T.children[V++];) {
                    if (W = K(U, X)) {
                        return W
                    }
                }
            }
        }
        function I(X, W, T) {
            if (X.type == "element" && X.tagName == W) {
                T.push(X)
            }
            if (X.children && X.children.length) {
                for (var V = 0,
                U; U = X.children[V++];) {
                    I(U, W, T)
                }
            }
        }
        function H(T, W) {
            if (T.children && T.children.length) {
                for (var V = 0,
                U; U = T.children[V];) {
                    H(U, W);
                    if (U.parentNode) {
                        if (U.children && U.children.length) {
                            W(U)
                        }
                        if (U.parentNode) {
                            V++
                        }
                    }
                }
            } else {
                W(T)
            }
        }
        L.prototype = {
            toHtml: function(U) {
                var T = [];
                Q(this, T, U, 0);
                return T.join("")
            },
            innerHTML: function(U) {
                if (this.type != "element" || u.$empty[this.tagName]) {
                    return this
                }
                if (C.isString(U)) {
                    if (this.children) {
                        for (var W = 0,
                        V; V = this.children[W++];) {
                            V.parentNode = null
                        }
                    }
                    this.children = [];
                    var T = UE.htmlparser(U);
                    for (var W = 0,
                    V; V = T.children[W++];) {
                        this.children.push(V);
                        V.parentNode = this
                    }
                    return this
                } else {
                    var T = new UE.uNode({
                        type: "root",
                        children: this.children
                    });
                    return T.toHtml()
                }
            },
            innerText: function(T) {
                if (this.type != "element" || u.$empty[this.tagName]) {
                    return this
                }
                if (T) {
                    if (this.children) {
                        for (var V = 0,
                        U; U = this.children[V++];) {
                            U.parentNode = null
                        }
                    }
                    this.children = [];
                    this.appendChild(L.createText(T));
                    return this
                } else {
                    return this.toHtml().replace(/<[^>]+>/g, "")
                }
            },
            getData: function() {
                if (this.type == "element") {
                    return ""
                }
                return this.data
            },
            firstChild: function() {
                return this.children ? this.children[0] : null
            },
            lastChild: function() {
                return this.children ? this.children[this.children.length - 1] : null
            },
            previousSibling: function() {
                var V = this.parentNode;
                for (var U = 0,
                T; T = V.children[U]; U++) {
                    if (T === this) {
                        return U == 0 ? null: V.children[U - 1]
                    }
                }
            },
            nextSibling: function() {
                var V = this.parentNode;
                for (var U = 0,
                T; T = V.children[U++];) {
                    if (T === this) {
                        return V.children[U]
                    }
                }
            },
            replaceChild: function(W, V) {
                if (this.children) {
                    if (W.parentNode) {
                        W.parentNode.removeChild(W)
                    }
                    for (var U = 0,
                    T; T = this.children[U]; U++) {
                        if (T === V) {
                            this.children.splice(U, 1, W);
                            V.parentNode = null;
                            W.parentNode = this;
                            return W
                        }
                    }
                }
            },
            appendChild: function(V) {
                if (this.type == "root" || (this.type == "element" && !u.$empty[this.tagName])) {
                    if (!this.children) {
                        this.children = []
                    }
                    if (V.parentNode) {
                        V.parentNode.removeChild(V)
                    }
                    for (var U = 0,
                    T; T = this.children[U]; U++) {
                        if (T === V) {
                            this.children.splice(U, 1);
                            break
                        }
                    }
                    this.children.push(V);
                    V.parentNode = this;
                    return V
                }
            },
            insertBefore: function(W, V) {
                if (this.children) {
                    if (W.parentNode) {
                        W.parentNode.removeChild(W)
                    }
                    for (var U = 0,
                    T; T = this.children[U]; U++) {
                        if (T === V) {
                            this.children.splice(U, 0, W);
                            W.parentNode = this;
                            return W
                        }
                    }
                }
            },
            insertAfter: function(W, V) {
                if (this.children) {
                    if (W.parentNode) {
                        W.parentNode.removeChild(W)
                    }
                    for (var U = 0,
                    T; T = this.children[U]; U++) {
                        if (T === V) {
                            this.children.splice(U + 1, 0, W);
                            W.parentNode = this;
                            return W
                        }
                    }
                }
            },
            removeChild: function(X, Y) {
                if (this.children) {
                    for (var W = 0,
                    V; V = this.children[W]; W++) {
                        if (V === X) {
                            this.children.splice(W, 1);
                            V.parentNode = null;
                            if (Y && V.children && V.children.length) {
                                for (var U = 0,
                                T; T = V.children[U]; U++) {
                                    this.children.splice(W + U, 0, T);
                                    T.parentNode = this
                                }
                            }
                            return V
                        }
                    }
                }
            },
            getAttr: function(T) {
                return this.attrs && this.attrs[T.toLowerCase()]
            },
            setAttr: function(V, U) {
                if (!V) {
                    delete this.attrs;
                    return
                }
                if (!this.attrs) {
                    this.attrs = {}
                }
                if (C.isObject(V)) {
                    for (var T in V) {
                        if (!V[T]) {
                            delete this.attrs[T]
                        } else {
                            this.attrs[T.toLowerCase()] = V[T]
                        }
                    }
                } else {
                    if (!U) {
                        delete this.attrs[V]
                    } else {
                        this.attrs[V.toLowerCase()] = U
                    }
                }
            },
            getIndex: function() {
                var V = this.parentNode;
                for (var U = 0,
                T; T = V.children[U]; U++) {
                    if (T === this) {
                        return U
                    }
                }
                return - 1
            },
            getNodeById: function(W) {
                var V;
                if (this.children && this.children.length) {
                    for (var U = 0,
                    T; T = this.children[U++];) {
                        if (V = K(T, W)) {
                            return V
                        }
                    }
                }
            },
            getNodesByTagName: function(U) {
                U = C.trim(U).replace(/[ ]{2,}/g, " ").split(" ");
                var T = [],
                V = this;
                C.each(U,
                function(Y) {
                    if (V.children && V.children.length) {
                        for (var X = 0,
                        W; W = V.children[X++];) {
                            I(W, Y, T)
                        }
                    }
                });
                return T
            },
            getStyle: function(U) {
                var W = this.getAttr("style");
                if (!W) {
                    return ""
                }
                var V = new RegExp(U + ":([^;]+)", "i");
                var T = W.match(V);
                if (T && T[0]) {
                    return T[1]
                }
                return ""
            },
            setStyle: function(V, W) {
                function U(Y, aa) {
                    var Z = new RegExp(Y + ":([^;]+;?)", "gi");
                    X = X.replace(Z, "");
                    if (aa) {
                        X = Y + ":" + C.unhtml(aa) + ";" + X
                    }
                }
                var X = this.getAttr("style");
                if (!X) {
                    X = ""
                }
                if (C.isObject(V)) {
                    for (var T in V) {
                        U(T, V[T])
                    }
                } else {
                    U(V, W)
                }
                this.setAttr("style", X)
            },
            traversal: function(T) {
                if (this.children && this.children.length) {
                    H(this, T)
                }
                return this
            }
        }
    })();
    var o = UE.htmlparser = function(J, W) {
        var Q = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,
        V = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g;
        var P = {
            b: 1,
            code: 1,
            i: 1,
            u: 1,
            strike: 1,
            s: 1,
            tt: 1,
            strong: 1,
            q: 1,
            samp: 1,
            em: 1,
            span: 1,
            sub: 1,
            img: 1,
            sup: 1,
            font: 1,
            big: 1,
            small: 1,
            iframe: 1,
            a: 1,
            br: 1,
            pre: 1
        };
        J = J.replace(new RegExp(w.fillChar, "g"), "");
        if (!W) {
            J = J.replace(new RegExp("[\\r\\t\\n" + (W ? "": " ") + "]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n" + (W ? "": " ") + "]*", "g"),
            function(aa, Z) {
                if (Z && P[Z.toLowerCase()]) {
                    return aa.replace(/(^[\n\r]+)|([\n\r]+$)/g, "")
                }
                return aa.replace(new RegExp("^[\\r\\n" + (W ? "": " ") + "]+"), "").replace(new RegExp("[\\r\\n" + (W ? "": " ") + "]+$"), "")
            })
        }
        var K = UE.uNode,
        S = {
            td: "tr",
            tr: ["tbody", "thead", "tfoot"],
            tbody: "table",
            th: "tr",
            thead: "table",
            tfoot: "table",
            caption: "table",
            li: ["ul", "ol"],
            dt: "dl",
            dd: "dl",
            option: "select"
        },
        T = {
            ol: "li",
            ul: "li"
        };
        function R(aa, ab) {
            if (T[aa.tagName]) {
                var Z = K.createElement(T[aa.tagName]);
                aa.appendChild(Z);
                Z.appendChild(K.createText(ab));
                aa = Z
            } else {
                aa.appendChild(K.createText(ab))
            }
        }
        function L(ae, aa, af) {
            var Z;
            if (Z = S[aa]) {
                var ab = ae,
                ah;
                while (ab.type != "root") {
                    if (C.isArray(Z) ? C.indexOf(Z, ab.tagName) != -1 : Z == ab.tagName) {
                        ae = ab;
                        ah = true;
                        break
                    }
                    ab = ab.parentNode
                }
                if (!ah) {
                    ae = L(ae, C.isArray(Z) ? Z[0] : Z)
                }
            }
            var ad = new K({
                parentNode: ae,
                type: "element",
                tagName: aa.toLowerCase(),
                children: u.$empty[aa] ? null: []
            });
            if (af) {
                var ag = {},
                ac;
                while (ac = V.exec(af)) {
                    ag[ac[1].toLowerCase()] = C.unhtml(ac[2] || ac[3] || ac[4])
                }
                ad.attrs = ag
            }
            ae.children.push(ad);
            return u.$empty[aa] ? ae: ad
        }
        function I(Z, aa) {
            Z.children.push(new K({
                type: "comment",
                data: aa,
                parentNode: Z
            }))
        }
        var N, H = 0,
        O = 0;
        var U = new K({
            type: "root",
            children: []
        });
        var Y = U;
        while (N = Q.exec(J)) {
            H = N.index;
            try {
                if (H > O) {
                    R(Y, J.slice(O, H))
                }
                if (N[3]) {
                    Y = L(Y, N[3].toLowerCase(), N[4])
                } else {
                    if (N[1]) {
                        if (Y.type != "root") {
                            var M = Y;
                            while (Y.type == "element" && Y.tagName != N[1].toLowerCase()) {
                                Y = Y.parentNode;
                                if (Y.type == "root") {
                                    Y = M;
                                    throw "break"
                                }
                            }
                            Y = Y.parentNode
                        }
                    } else {
                        if (N[2]) {
                            I(Y, N[2])
                        }
                    }
                }
            } catch(X) {}
            O = Q.lastIndex
        }
        if (O < J.length) {
            R(Y, J.slice(O))
        }
        return U
    };
    var v = UE.filterNode = function() {
        function H(L, S) {
            switch (L.type) {
                case "text":
                    break;
                case "element":
                    var J;
                    if (J = S[L.tagName]) {
                        if (J === "-") {
                            L.parentNode.removeChild(L)
                        } else {
                            if (C.isFunction(J)) {
                                var O = L.parentNode,
                                P = L.getIndex();
                                J(L);
                                if (L.parentNode) {
                                    if (L.children) {
                                        for (var M = 0,
                                        T; T = L.children[M];) {
                                            H(T, S);
                                            if (T.parentNode) {
                                                M++
                                            }
                                        }
                                    }
                                } else {
                                    for (var M = P,
                                    T; T = O.children[M];) {
                                        H(T, S);
                                        if (T.parentNode) {
                                            M++
                                        }
                                    }
                                }
                            } else {
                                var R = J["$"];
                                if (R && L.attrs) {
                                    var K = {},
                                    I;
                                    for (var Q in R) {
                                        I = L.getAttr(Q);
                                        if (Q == "style" && C.isArray(R[Q])) {
                                            var N = [];
                                            C.each(R[Q],
                                            function(U) {
                                                var V;
                                                if (V = L.getStyle(U)) {
                                                    N.push(U + ":" + V)
                                                }
                                            });
                                            I = N.join(";")
                                        }
                                        if (I) {
                                            K[Q] = I
                                        }
                                    }
                                    L.attrs = K
                                }
                                if (L.children) {
                                    for (var M = 0,
                                    T; T = L.children[M];) {
                                        H(T, S);
                                        if (T.parentNode) {
                                            M++
                                        }
                                    }
                                }
                            }
                        }
                    } else {
                        if (u.$cdata[L.tagName]) {
                            L.parentNode.removeChild(L)
                        } else {
                            var O = L.parentNode,
                            P = L.getIndex();
                            L.parentNode.removeChild(L, true);
                            for (var M = P,
                            T; T = O.children[M];) {
                                H(T, S);
                                if (T.parentNode) {
                                    M++
                                }
                            }
                        }
                    }
                    break;
                case "comment":
                    L.parentNode.removeChild(L)
            }
        }
        return function(I, M) {
            if (C.isEmptyObject(M)) {
                return I
            }
            var L;
            if (L = M["-"]) {
                C.each(L.split(" "),
                function(N) {
                    M[N] = "-"
                })
            }
            for (var K = 0,
            J; J = I.children[K];) {
                H(J, M);
                if (J.parentNode) {
                    K++
                }
            }
            return I
        }
    } (); UE.plugins.basestyle = function() {
        var K = {
            bold: ["strong", "b"],
            italic: ["em", "i"],
            subscript: ["sub"],
            superscript: ["sup"]
        },
        J = function(M, L) {
            return w.filterNodeList(M.selection.getStartElementPath(), L)
        },
        I = this;
        I.addshortcutkey({
            Bold: "ctrl+66",
            Italic: "ctrl+73",
            Underline: "ctrl+85"
        });
        I.addInputRule(function(L) {
            C.each(L.getNodesByTagName("b i"),
            function(M) {
                switch (M.tagName) {
                    case "b":
                        M.tagName = "strong";
                        break;
                    case "i":
                        M.tagName = "em"
                }
            })
        });
        for (var H in K) { (function(M, L) {
            I.commands[M] = {
                execCommand: function(O) {
                    var N = I.selection.getRange(),
                    R = J(this, L);
                    if (N.collapsed) {
                        if (R) {
                            var Q = I.document.createTextNode("");
                            N.insertNode(Q).removeInlineStyle(L);
                            N.setStartBefore(Q);
                            w.remove(Q)
                        } else {
                            var P = N.document.createElement(L[0]);
                            if (O == "superscript" || O == "subscript") {
                                Q = I.document.createTextNode("");
                                N.insertNode(Q).removeInlineStyle(["sub", "sup"]).setStartBefore(Q).collapse(true)
                            }
                            N.insertNode(P).setStart(P, 0)
                        }
                        N.collapse(true)
                    } else {
                        if (O == "superscript" || O == "subscript") {
                            if (!R || R.tagName.toLowerCase() != O) {
                                N.removeInlineStyle(["sub", "sup"])
                            }
                        }
                        R ? N.removeInlineStyle(L) : N.applyInlineStyle(L[0])
                    }
                    N.select()
                },
                queryCommandState: function() {
                    return J(this, L) ? 1 : 0
                }
            }
        })(H, K[H])
        }
    }; UE.plugins.defaultfilter = function() {
        var H = this;
        H.addInputRule(function(I) {
            var J;
            I.traversal(function(M) {
                if (M.type == "element") {
                    if (!u.$cdata[M.tagName] && H.options.autoClearEmptyNode && u.$inline[M.tagName] && !u.$empty[M.tagName] && (!M.attrs || C.isEmptyObject(M.attrs))) {
                        if (!M.firstChild()) {
                            M.parentNode.removeChild(M)
                        } else {
                            if (M.tagName == "span" && (!M.attrs || C.isEmptyObject(M.attrs))) {
                                M.parentNode.removeChild(M, true)
                            }
                        }
                        return
                    }
                    switch (M.tagName) {
                        case "style":
                        case "script":
                            M.setAttr({
                                cdata_tag:
                                M.tagName,
                                cdata_data: encodeURIComponent(M.innerText() || "")
                            });
                            M.tagName = "div";
                            M.removeChild(M.firstChild());
                            break;
                        case "a":
                            if (J = M.getAttr("href")) {
                                M.setAttr("_href", J)
                            }
                            break;
                        case "img":
                            if (J = M.getAttr("src")) {
                                if (/^data:/.test(J)) {
                                    M.parentNode.removeChild(M);
                                    break
                                }
                            }
                            M.setAttr("_src", M.getAttr("src"));
                            break;
                        case "span":
                            if (E.webkit && (J = M.getStyle("white-space"))) {
                                if (/nowrap|normal/.test(J)) {
                                    M.setStyle("white-space", "");
                                    if (H.options.autoClearEmptyNode && C.isEmptyObject(M.attrs)) {
                                        M.parentNode.removeChild(M, true)
                                    }
                                }
                            }
                            break;
                        case "p":
                            if (J = M.getAttr("align")) {
                                M.setAttr("align");
                                M.setStyle("text-align", J)
                            }
                            var P = M.getAttr("style");
                            if (P) {
                                P = P.replace(/(margin|padding)[^;]+/g, "");
                                M.setAttr("style", P)
                            }
                            if (!M.firstChild()) {
                                M.innerHTML(UE.browser.ie ? "&nbsp;": "<br>")
                            }
                            break;
                        case "div":
                            if (M.getAttr("cdata_tag")) {
                                break
                            }
                            J = M.getAttr("class");
                            if (J && /^line number\d+/.test(J)) {
                                break
                            }
                            var L, O = UE.uNode.createElement("p");
                            while (L = M.firstChild()) {
                                if (L.type == "text" || !UE.dom.dtd.$block[L.tagName]) {
                                    O.appendChild(L)
                                } else {
                                    if (O.firstChild()) {
                                        M.parentNode.insertBefore(O, M);
                                        O = UE.uNode.createElement("p")
                                    } else {
                                        M.parentNode.insertBefore(L, M)
                                    }
                                }
                            }
                            if (O.firstChild()) {
                                M.parentNode.insertBefore(O, M)
                            }
                            M.parentNode.removeChild(M);
                            break;
                        case "dl":
                            M.tagName = "ul";
                            break;
                        case "dt":
                        case "dd":
                            M.tagName = "li";
                            break;
                        case "li":
                            var K = M.getAttr("class");
                            if (!K || !/list\-/.test(K)) {
                                M.setAttr()
                            }
                            var N = M.getNodesByTagName("ol ul");
                            UE.utils.each(N,
                            function(Q) {
                                M.parentNode.insertAfter(Q, M)
                            });
                            break;
                        case "td":
                        case "th":
                        case "caption":
                            if (!M.children || !M.children.length) {
                                M.appendChild(E.ie ? UE.uNode.createText(" ") : UE.uNode.createElement("br"))
                            }
                    }
                }
                if (M.type == "comment") {
                    M.parentNode.removeChild(M)
                }
            })
        });
        H.addOutputRule(function(I) {
            var J;
            I.traversal(function(K) {
                if (K.type == "element") {
                    if (H.options.autoClearEmptyNode && u.$inline[K.tagName] && !u.$empty[K.tagName] && (!K.attrs || C.isEmptyObject(K.attrs))) {
                        if (!K.firstChild()) {
                            K.parentNode.removeChild(K)
                        } else {
                            if (K.tagName == "span" && (!K.attrs || C.isEmptyObject(K.attrs))) {
                                K.parentNode.removeChild(K, true)
                            }
                        }
                        return
                    }
                    switch (K.tagName) {
                        case "div":
                            if (J = K.getAttr("cdata_tag")) {
                                K.tagName = J;
                                K.appendChild(UE.uNode.createText(K.getAttr("cdata_data")));
                                K.setAttr({
                                    cdata_tag: "",
                                    cdata_data: ""
                                })
                            }
                            break;
                        case "a":
                            if (J = K.getAttr("_href")) {
                                K.setAttr({
                                    href: J,
                                    _href: ""
                                })
                            }
                            break;
                        case "img":
                            if (J = K.getAttr("_src")) {
                                K.setAttr({
                                    src: K.getAttr("_src"),
                                    _src: ""
                                })
                            }
                    }
                }
            })
        })
    }; UE.commands.inserthtml = {
        execCommand: function(I, O, V) {
            var aa = this,
            Q, R;
            if (!O) {
                return
            }
            if (aa.fireEvent("beforeinserthtml", O) === true) {
                return
            }
            Q = aa.selection.getRange();
            R = Q.document.createElement("div");
            R.style.display = "inline";
            if (!V) {
                var W = UE.htmlparser(O);
                if (aa.options.filterRules) {
                    UE.filterNode(W, aa.options.filterRules)
                }
                aa.filterInputRule(W);
                O = W.toHtml()
            }
            R.innerHTML = C.trim(O);
            if (!Q.collapsed) {
                var Z = Q.startContainer;
                if (w.isFillChar(Z)) {
                    Q.setStartBefore(Z)
                }
                Z = Q.endContainer;
                if (w.isFillChar(Z)) {
                    Q.setEndAfter(Z)
                }
                Q.txtToElmBoundary();
                if (Q.endContainer && Q.endContainer.nodeType == 1) {
                    Z = Q.endContainer.childNodes[Q.endOffset];
                    if (Z && w.isBr(Z)) {
                        Q.setEndAfter(Z)
                    }
                }
                if (Q.startOffset == 0) {
                    Z = Q.startContainer;
                    if (w.isBoundaryNode(Z, "firstChild")) {
                        Z = Q.endContainer;
                        if (Q.endOffset == (Z.nodeType == 3 ? Z.nodeValue.length: Z.childNodes.length) && w.isBoundaryNode(Z, "lastChild")) {
                            aa.body.innerHTML = "<p>" + (E.ie ? "": "<br/>") + "</p>";
                            Q.setStart(aa.body.firstChild, 0).collapse(true)
                        }
                    }
                } ! Q.collapsed && Q.deleteContents();
                if (Q.startContainer.nodeType == 1) {
                    var K = Q.startContainer.childNodes[Q.startOffset],
                    T;
                    if (K && w.isBlockElm(K) && (T = K.previousSibling) && w.isBlockElm(T)) {
                        Q.setEnd(T, T.childNodes.length).collapse();
                        while (K.firstChild) {
                            T.appendChild(K.firstChild)
                        }
                        w.remove(K)
                    }
                }
            }
            var K, N, T, Y, J = 0,
            H;
            if (Q.inFillChar()) {
                K = Q.startContainer;
                if (w.isFillChar(K)) {
                    Q.setStartBefore(K).collapse(true);
                    w.remove(K)
                } else {
                    if (w.isFillChar(K, true)) {
                        K.nodeValue = K.nodeValue.replace(x, "");
                        Q.startOffset--;
                        Q.collapsed && Q.collapse(true)
                    }
                }
            }
            var P = w.findParentByTagName(Q.startContainer, "li", true);
            if (P) {
                var U, M;
                while (K = R.firstChild) {
                    while (K && (K.nodeType == 3 || !w.isBlockElm(K) || K.tagName == "HR")) {
                        U = K.nextSibling;
                        Q.insertNode(K).collapse();
                        M = K;
                        K = U
                    }
                    if (K) {
                        if (/^(ol|ul)$/i.test(K.tagName)) {
                            while (K.firstChild) {
                                M = K.firstChild;
                                w.insertAfter(P, K.firstChild);
                                P = P.nextSibling
                            }
                            w.remove(K)
                        } else {
                            var L;
                            U = K.nextSibling;
                            L = aa.document.createElement("li");
                            w.insertAfter(P, L);
                            L.appendChild(K);
                            M = K;
                            K = U;
                            P = L
                        }
                    }
                }
                P = w.findParentByTagName(Q.startContainer, "li", true);
                if (w.isEmptyBlock(P)) {
                    w.remove(P)
                }
                if (M) {
                    Q.setStartAfter(M).collapse(true).select(true)
                }
            } else {
                while (K = R.firstChild) {
                    if (J) {
                        var S = aa.document.createElement("p");
                        while (K && (K.nodeType == 3 || !u.$block[K.tagName])) {
                            H = K.nextSibling;
                            S.appendChild(K);
                            K = H
                        }
                        if (S.firstChild) {
                            K = S
                        }
                    }
                    Q.insertNode(K);
                    H = K.nextSibling;
                    if (!J && K.nodeType == w.NODE_ELEMENT && w.isBlockElm(K)) {
                        N = w.findParent(K,
                        function(ab) {
                            return w.isBlockElm(ab)
                        });
                        if (N && N.tagName.toLowerCase() != "body" && !(u[N.tagName][K.nodeName] && K.parentNode === N)) {
                            if (!u[N.tagName][K.nodeName]) {
                                T = N
                            } else {
                                Y = K.parentNode;
                                while (Y !== N) {
                                    T = Y;
                                    Y = Y.parentNode
                                }
                            }
                            w.breakParent(K, T || Y);
                            var T = K.previousSibling;
                            w.trimWhiteTextNode(T);
                            if (!T.childNodes.length) {
                                w.remove(T)
                            }
                            if (!E.ie && (U = K.nextSibling) && w.isBlockElm(U) && U.lastChild && !w.isBr(U.lastChild)) {
                                U.appendChild(aa.document.createElement("br"))
                            }
                            J = 1
                        }
                    }
                    var U = K.nextSibling;
                    if (!R.firstChild && U && w.isBlockElm(U)) {
                        Q.setStart(U, 0).collapse(true);
                        break
                    }
                    Q.setEndAfter(K).collapse()
                }
                K = Q.startContainer;
                if (H && w.isBr(H)) {
                    w.remove(H)
                }
                if (w.isBlockElm(K) && w.isEmptyNode(K)) {
                    if (H = K.nextSibling) {
                        w.remove(K);
                        if (H.nodeType == 1 && u.$block[H.tagName]) {
                            Q.setStart(H, 0).collapse(true).shrinkBoundary()
                        }
                    } else {
                        try {
                            K.innerHTML = E.ie ? w.fillChar: "<br/>"
                        } catch(X) {
                            Q.setStartBefore(K);
                            w.remove(K)
                        }
                    }
                }
                try {
                    Q.select(true)
                } catch(X) {}
            }
            setTimeout(function() {
                Q = aa.selection.getRange();
                Q.scrollToView(aa.autoHeightEnabled, aa.autoHeightEnabled ? w.getXY(aa.iframe).y: 0);
                aa.fireEvent("afterinserthtml")
            },
            200)
        }
    }; UE.plugins.autotypeset = function() {
        this.setOpt({
            autotypeset: {
                mergeEmptyline: true,
                indent: false,
                indentValue: "2em"
            }
        });
        var P = this,
        H = P.options.autotypeset,
        I = {
            selectTdClass: 1,
            pagebreak: 1,
            anchorclass: 1
        },
        J = {
            li: 1
        },
        R = {
            div: 1,
            p: 1,
            blockquote: 1,
            center: 1,
            h1: 1,
            h2: 1,
            h3: 1,
            h4: 1,
            h5: 1,
            h6: 1
        },
        M;
        if (!H) {
            return
        }
        function L(T, S) {
            if (T && T.parentNode && R[T.tagName.toLowerCase()]) {
                if (M && M.contains(T) || T.getAttribute("pagebreak")) {
                    return 0
                }
                return S ? !w.isEmptyBlock(T) : w.isEmptyBlock(T)
            }
        }
        function N(S) {
            if (!S.style.cssText) {
                w.removeAttributes(S, ["style"]);
                if (S.tagName.toLowerCase() == "span" && w.hasNoAttributes(S)) {
                    w.remove(S, true)
                }
            }
        }
        function O(ae, ab) {
            var ag = P.selection.getRange(),
            ad = ag.createBookmark(true),
            ai;
            if (ab) {
                if (!H.pasteFilter) {
                    return
                }
                ai = P.document.createElement("div");
                ai.innerHTML = ab.html
            } else {
                var S;
                if (ag.collapsed) {
                    ai = P.document.body;
                    S = w.getElementsByTagName(ai, "*")
                } else {
                    ag.txtToElmBoundary();
                    var T = ag.startContainer,
                    V = ag.endContainer,
                    af = w.getNodeIndex(T.tagName.toLowerCase() == "body" ? T.firstChild: T),
                    aa = w.getNodeIndex(V.tagName.toLowerCase() == "body" ? V.lastChild: V),
                    ac = P.document.body.children,
                    Z = [];
                    for (var W = af; W <= aa; W++) {
                        Z.push(ac[W])
                    }
                    S = Z
                }
            }
            for (var X = 0,
            ah; ah = S[X++];) {
                if (!M && ah.tagName == "DIV" && ah.getAttribute("highlighter")) {
                    M = ah
                }
                if (L(ah)) {
                    if (H.mergeEmptyline) {
                        var Y = ah.nextSibling,
                        U;
                        while (L(Y)) {
                            U = Y;
                            Y = U.nextSibling;
                            w.remove(U)
                        }
                    }
                    if (H.removeEmptyline && w.inDoc(ah, ai) && !J[ah.parentNode.tagName.toLowerCase()]) {
                        w.remove(ah);
                        continue
                    }
                }
                if (L(ah, true)) {
                    if (H.indent) {
                        K(ah)
                    }
                    if (H.textAlign) {
                        ah.style.textAlign = H.textAlign
                    }
                }
            }
            if (ab) {
                ab.html = ai.innerHTML
            }
            ag.moveToBookmark(ad).select()
        }
        function K(T) {
            if (w.findParent(T,
            function(W) {
                return W.nodeType == 1 && W.tagName.toLowerCase() == "li"
            })) {
                return
            }
            var V = T.firstChild;
            var S = V;
            while (V && V.nodeType == 1 && !u.$empty[V.tagName]) {
                if (w.isBookmarkNode(V)) {
                    V = V.nextSibling
                }
                S = V;
                V = V.firstChild
            }
            if (S && S.nodeType == 1 && /img|iframe|br/ig.test(S.tagName)) {
                return
            }
            var U = (S.innerText || S.textContent || S.nodeValue).replace(/(^\u3000*)|(\u3000*$)/g, "").replace(/(^\s*)|(\s*$)/g, "");
            Q(S, U);
            S.parentNode.insertBefore(T.ownerDocument.createTextNode("\u3000\u3000"), S)
        }
        function Q(S, T) {
            if (typeof S.textContent == "string") {
                S.textContent = T
            } else {
                if (typeof S.nodeValue == "string") {
                    S.nodeValue = T
                } else {
                    S.innerText = T
                }
            }
        }
        P.commands.autotypeset = {
            execCommand: function() {
                O()
            }
        }
    }; UE.commands.imagefloat = {
        execCommand: function(H, N) {
            var P = this,
            M = P.selection.getRange();
            if (!M.collapsed) {
                var K = M.getClosedNode();
                if (K && K.tagName == "IMG") {
                    switch (N) {
                        case "left":
                        case "right":
                        case "none":
                            var O = K.parentNode,
                            I, J, L;
                            while (u.$inline[O.tagName] || O.tagName == "A") {
                                O = O.parentNode
                            }
                            I = O;
                            if (I.tagName == "P" && w.getStyle(I, "text-align") == "center") {
                                if (!w.isBody(I) && w.getChildCount(I,
                                function(Q) {
                                    return ! w.isBr(Q) && !w.isWhitespace(Q)
                                }) == 1) {
                                    J = I.previousSibling;
                                    L = I.nextSibling;
                                    if (J && L && J.nodeType == 1 && L.nodeType == 1 && J.tagName == L.tagName && w.isBlockElm(J)) {
                                        J.appendChild(I.firstChild);
                                        while (L.firstChild) {
                                            J.appendChild(L.firstChild)
                                        }
                                        w.remove(I);
                                        w.remove(L)
                                    } else {
                                        w.setStyle(I, "text-align", "")
                                    }
                                }
                                M.selectNode(K).select()
                            }
                            w.setStyle(K, "float", N == "none" ? "": N);
                            if (N == "none") {
                                w.removeAttributes(K, "align")
                            }
                            break;
                        case "center":
                            if (P.queryCommandValue("imagefloat") != "center") {
                                O = K.parentNode;
                                w.setStyle(K, "float", "");
                                w.removeAttributes(K, "align");
                                I = K;
                                while (O && w.getChildCount(O,
                                function(Q) {
                                    return ! w.isBr(Q) && !w.isWhitespace(Q)
                                }) == 1 && (u.$inline[O.tagName] || O.tagName == "A")) {
                                    I = O;
                                    O = O.parentNode
                                }
                                M.setStartBefore(I).setCursor(false);
                                O = P.document.createElement("div");
                                O.appendChild(I);
                                w.setStyle(I, "float", "");
                                P.execCommand("insertHtml", '<p id="_img_parent_tmp" style="text-align:center">' + O.innerHTML + "</p>");
                                I = P.document.getElementById("_img_parent_tmp");
                                I.removeAttribute("id");
                                I = I.firstChild;
                                M.selectNode(I).select();
                                L = I.parentNode.nextSibling;
                                if (L && w.isEmptyNode(L)) {
                                    w.remove(L)
                                }
                            }
                            break
                    }
                }
            }
        },
        queryCommandValue: function() {
            var H = this.selection.getRange(),
            I,
            J;
            if (H.collapsed) {
                return "none"
            }
            I = H.getClosedNode();
            if (I && I.nodeType == 1 && I.tagName == "IMG") {
                J = I.getAttribute("align") || w.getComputedStyle(I, "float");
                if (J == "none") {
                    J = w.getComputedStyle(I.parentNode, "text-align") == "center" ? "center": J
                }
                return {
                    left: 1,
                    right: 1,
                    center: 1
                } [J] ? J: "none"
            }
            return "none"
        },
        queryCommandState: function() {
            var H = this.selection.getRange(),
            I;
            if (H.collapsed) {
                return - 1
            }
            I = H.getClosedNode();
            if (I && I.nodeType == 1 && I.tagName == "IMG") {
                return 0
            }
            return - 1
        }
    }; UE.commands.insertimage = {
        execCommand: function(I, H) {
            H = C.isArray(H) ? H: [H];
            if (!H.length) {
                return
            }
            var P = this,
            N = P.selection.getRange(),
            K = N.getClosedNode();
            if (K && /img/i.test(K.tagName) && K.className != "edui-faked-video" && !K.getAttribute("word_img")) {
                var L = H.shift();
                var Q = L.floatStyle;
                delete L.floatStyle;
                w.setAttributes(K, L);
                P.execCommand("imagefloat", Q);
                if (H.length > 0) {
                    N.setStartAfter(K).setCursor(false, true);
                    P.execCommand("insertimage", H)
                }
            } else {
                var M = [],
                O = "",
                R;
                R = H[0];
                if (H.length == 1) {
                    O = '<img src="' + R.src + '" ' + (R._src ? ' _src="' + R._src + '" ': "") + (R.width ? 'width="' + R.width + '" ': "") + (R.height ? ' height="' + R.height + '" ': "") + (R.floatStyle == "left" || R.floatStyle == "right" ? ' style="float:' + R.floatStyle + ';"': "") + (R.title && R.title != "" ? ' title="' + R.title + '"': "") + (R.border && R.border != "0" ? ' border="' + R.border + '"': "") + (R.alt && R.alt != "" ? ' alt="' + R.alt + '"': "") + (R.hspace && R.hspace != "0" ? ' hspace = "' + R.hspace + '"': "") + (R.vspace && R.vspace != "0" ? ' vspace = "' + R.vspace + '"': "") + "/>";
                    if (R.floatStyle == "center") {
                        O = '<p style="text-align: center">' + O + "</p>"
                    }
                    M.push(O)
                } else {
                    for (var J = 0; R = H[J++];) {
                        O = "<p " + (R.floatStyle == "center" ? 'style="text-align: center" ': "") + '><img src="' + R.src + '" ' + (R.width ? 'width="' + R.width + '" ': "") + (R._src ? ' _src="' + R._src + '" ': "") + (R.height ? ' height="' + R.height + '" ': "") + ' style="' + (R.floatStyle && R.floatStyle != "center" ? "float:" + R.floatStyle + ";": "") + (R.border || "") + '" ' + (R.title ? ' title="' + R.title + '"': "") + " /></p>";
                        M.push(O)
                    }
                }
                P.execCommand("insertHtml", M.join(""))
            }
        }
    }; UE.plugins.selectall = function() {
        var H = this;
        H.commands.selectall = {
            execCommand: function() {
                var K = this,
                I = K.body,
                J = K.selection.getRange();
                J.selectNodeContents(I);
                if (w.isEmptyBlock(I)) {
                    if (E.opera && I.firstChild && I.firstChild.nodeType == 1) {
                        J.setStartAtFirst(I.firstChild)
                    }
                    J.collapse(true)
                }
                J.select(true)
            },
            notNeedUndo: 1
        };
        H.addshortcutkey({
            selectAll: "ctrl+65"
        })
    }; UE.plugins.wordcount = function() {
        var H = this;
        H.addListener("contentchange",
        function() {
            H.fireEvent("wordcount")
        });
        var I;
        H.addListener("ready",
        function() {
            var J = this;
            w.on(J.body, "keyup",
            function(K) {
                var L = K.keyCode || K.which,
                M = {
                    "16": 1,
                    "18": 1,
                    "20": 1,
                    "37": 1,
                    "38": 1,
                    "39": 1,
                    "40": 1
                };
                if (L in M) {
                    return
                }
                clearTimeout(I);
                I = setTimeout(function() {
                    J.fireEvent("wordcount")
                },
                200)
            })
        })
    }; UE.plugins.undo = function() {
        var K;
        var T = this,
        W = T.options.maxUndoCount || 20,
        S = T.options.maxInputCount || 20,
        N = new RegExp(w.fillChar + "|</hr>", "gi");
        var P = {
            ol: 1,
            ul: 1,
            table: 1,
            tbody: 1,
            tr: 1,
            body: 1
        };
        var L = T.options.autoClearEmptyNode;
        function Q(aa, Z) {
            if (aa.length != Z.length) {
                return 0
            }
            for (var Y = 0,
            X = aa.length; Y < X; Y++) {
                if (aa[Y] != Z[Y]) {
                    return 0
                }
            }
            return 1
        }
        function U(Y, X) {
            if (Y.collapsed != X.collapsed) {
                return 0
            }
            if (!Q(Y.startAddress, X.startAddress) || !Q(Y.endAddress, X.endAddress)) {
                return 0
            }
            return 1
        }
        function I() {
            this.list = [];
            this.index = 0;
            this.hasUndo = false;
            this.hasRedo = false;
            this.undo = function() {
                if (this.hasUndo) {
                    if (!this.list[this.index - 1] && this.list.length == 1) {
                        this.reset();
                        return
                    }
                    while (this.list[this.index].content == this.list[this.index - 1].content) {
                        this.index--;
                        if (this.index == 0) {
                            return this.restore(0)
                        }
                    }
                    this.restore(--this.index)
                }
            };
            this.redo = function() {
                if (this.hasRedo) {
                    while (this.list[this.index].content == this.list[this.index + 1].content) {
                        this.index++;
                        if (this.index == this.list.length - 1) {
                            return this.restore(this.index)
                        }
                    }
                    this.restore(++this.index)
                }
            };
            this.restore = function() {
                var Z = this.editor;
                var ab = this.list[this.index];
                var Y = UE.htmlparser(ab.content.replace(N, ""));
                Z.options.autoClearEmptyNode = false;
                Z.filterInputRule(Y);
                Z.options.autoClearEmptyNode = L;
                Z.document.body.innerHTML = Y.toHtml();
                Z.fireEvent("afterscencerestore");
                if (E.ie) {
                    C.each(w.getElementsByTagName(Z.document, "td th caption p"),
                    function(ac) {
                        if (w.isEmptyNode(ac)) {
                            w.fillNode(Z.document, ac)
                        }
                    })
                }
                try {
                    var X = new y.Range(Z.document).moveToAddress(ab.address);
                    X.select(P[X.startContainer.nodeName.toLowerCase()])
                } catch(aa) {}
                this.update();
                this.clearKey();
                Z.fireEvent("reset", true)
            };
            this.getScene = function(aa) {
                var ab = this.editor;
                var Z = ab.selection.getRange(),
                ad = Z.createAddress(false, true);
                ab.fireEvent("beforegetscene");
                var Y = UE.htmlparser(ab.body.innerHTML, true);
                ab.options.autoClearEmptyNode = false;
                ab.filterOutputRule(Y);
                ab.options.autoClearEmptyNode = L;
                var X = Y.toHtml();
                E.ie && (X = X.replace(/>&nbsp;</g, "><").replace(/\s*</g, "<").replace(/>\s*/g, ">"));
                ab.fireEvent("aftergetscene");
                try {} catch(ac) {}
                return {
                    address: ad,
                    content: X
                }
            };
            this.save = function(aa, X) {
                clearTimeout(K);
                var Z = this.getScene(X),
                Y = this.list[this.index];
                if (Y && Y.content == Z.content && (aa ? 1 : U(Y.address, Z.address))) {
                    return
                }
                this.list = this.list.slice(0, this.index + 1);
                this.list.push(Z);
                if (this.list.length > W) {
                    this.list.shift()
                }
                this.index = this.list.length - 1;
                this.clearKey();
                this.update()
            };
            this.update = function() {
                this.hasRedo = !!this.list[this.index + 1];
                this.hasUndo = !!this.list[this.index - 1]
            };
            this.reset = function() {
                this.list = [];
                this.index = 0;
                this.hasUndo = false;
                this.hasRedo = false;
                this.clearKey()
            };
            this.clearKey = function() {
                O = 0;
                H = null
            }
        }
        T.undoManger = new I();
        T.undoManger.editor = T;
        function R() {
            this.undoManger.save()
        }
        T.addListener("saveScene",
        function() {
            var X = Array.prototype.splice.call(arguments, 1);
            this.undoManger.save.apply(this.undoManger, X)
        });
        T.addListener("beforeexeccommand", R);
        T.addListener("afterexeccommand", R);
        T.addListener("reset",
        function(Y, X) {
            if (!X) {
                this.undoManger.reset()
            }
        });
        T.commands.redo = T.commands.undo = {
            execCommand: function(X) {
                this.undoManger[X]()
            },
            queryCommandState: function(X) {
                return this.undoManger["has" + (X.toLowerCase() == "undo" ? "Undo": "Redo")] ? 0 : -1
            },
            notNeedUndo: 1
        };
        var V = {
            16 : 1,
            17 : 1,
            18 : 1,
            37 : 1,
            38 : 1,
            39 : 1,
            40 : 1
        },
        O = 0,
        H;
        var J = false;
        T.addListener("ready",
        function() {
            w.on(this.body, "compositionstart",
            function() {
                J = true
            });
            w.on(this.body, "compositionend",
            function() {
                J = false
            })
        });
        T.addshortcutkey({
            Undo: "ctrl+90",
            Redo: "ctrl+89"
        });
        var M = true;
        T.addListener("keydown",
        function(Y, X) {
            var aa = this;
            var ab = X.keyCode || X.which;
            if (!V[ab] && !X.ctrlKey && !X.metaKey && !X.shiftKey && !X.altKey) {
                if (J) {
                    return
                }
                if (!aa.selection.getRange().collapsed) {
                    aa.undoManger.save(false, true);
                    M = false;
                    return
                }
                if (aa.undoManger.list.length == 0) {
                    aa.undoManger.save(true)
                }
                clearTimeout(K);
                function Z(ac) {
                    if (ac.selection.getRange().collapsed) {
                        ac.fireEvent("contentchange")
                    }
                    ac.undoManger.save(false, true);
                    ac.fireEvent("selectionchange")
                }
                K = setTimeout(function() {
                    if (J) {
                        var ac = setInterval(function() {
                            if (!J) {
                                Z(aa);
                                clearInterval(ac)
                            }
                        },
                        300);
                        return
                    }
                    Z(aa)
                },
                200);
                H = ab;
                O++;
                if (O >= S) {
                    Z(aa)
                }
            }
        });
        T.addListener("keyup",
        function(Y, X) {
            var Z = X.keyCode || X.which;
            if (!V[Z] && !X.ctrlKey && !X.metaKey && !X.shiftKey && !X.altKey) {
                if (J) {
                    return
                }
                if (!M) {
                    this.undoManger.save(false, true);
                    M = true
                }
            }
        })
    }; UE.plugins.paste = function() {
        function K(R) {
            var P = this.document;
            if (P.getElementById("baidu_pastebin")) {
                return
            }
            var O = this.selection.getRange(),
            N = O.createBookmark(),
            Q = P.createElement("div");
            Q.id = "baidu_pastebin";
            E.webkit && Q.appendChild(P.createTextNode(w.fillChar + w.fillChar));
            P.body.appendChild(Q);
            N.start.style.display = "";
            Q.style.cssText = "position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:" + w.getXY(N.start).y + "px";
            O.selectNodeContents(Q).select(true);
            setTimeout(function() {
                if (E.webkit) {
                    for (var S = 0,
                    T = P.querySelectorAll("#baidu_pastebin"), V; V = T[S++];) {
                        if (w.isEmptyNode(V)) {
                            w.remove(V)
                        } else {
                            Q = V;
                            break
                        }
                    }
                }
                try {
                    Q.parentNode.removeChild(Q)
                } catch(U) {}
                O.moveToBookmark(N).select(true);
                R(Q)
            },
            0)
        }
        var L = this;
        var J, M, H;
        function I(N) {
            var S;
            if (N.firstChild) {
                var O = w.getElementsByTagName(N, "span");
                for (var R = 0,
                P; P = O[R++];) {
                    if (P.id == "_baidu_cut_start" || P.id == "_baidu_cut_end") {
                        w.remove(P)
                    }
                }
                if (E.webkit) {
                    var W = N.querySelectorAll("div br");
                    for (var R = 0,
                    Q; Q = W[R++];) {
                        var X = Q.parentNode;
                        if (X.tagName == "DIV" && X.childNodes.length == 1) {
                            X.innerHTML = "<p><br/></p>";
                            w.remove(X)
                        }
                    }
                    var Y = N.querySelectorAll("#baidu_pastebin");
                    for (var R = 0,
                    V; V = Y[R++];) {
                        var ad = L.document.createElement("p");
                        V.parentNode.insertBefore(ad, V);
                        while (V.firstChild) {
                            ad.appendChild(V.firstChild)
                        }
                        w.remove(V)
                    }
                    var U = N.querySelectorAll("meta");
                    for (var R = 0,
                    ac; ac = U[R++];) {
                        w.remove(ac)
                    }
                    var W = N.querySelectorAll("br");
                    for (R = 0; ac = W[R++];) {
                        if (/^apple-/i.test(ac.className)) {
                            w.remove(ac)
                        }
                    }
                }
                if (E.gecko) {
                    var ab = N.querySelectorAll("[_moz_dirty]");
                    for (R = 0; ac = ab[R++];) {
                        ac.removeAttribute("_moz_dirty")
                    }
                }
                if (!E.ie) {
                    var T = N.querySelectorAll("span.Apple-style-span");
                    for (var R = 0,
                    ac; ac = T[R++];) {
                        w.remove(ac, true)
                    }
                }
                S = N.innerHTML;
                S = UE.filterWord(S);
                var Z = UE.htmlparser(S, true);
                if (L.options.filterRules) {
                    UE.filterNode(Z, L.options.filterRules)
                }
                L.filterInputRule(Z);
                if (E.webkit) {
                    var aa = Z.lastChild();
                    if (aa && aa.type == "element" && aa.tagName == "br") {
                        Z.removeChild(aa)
                    }
                    C.each(L.body.querySelectorAll("div"),
                    function(ae) {
                        if (w.isEmptyBlock(ae)) {
                            w.remove(ae)
                        }
                    })
                }
                S = {
                    html: Z.toHtml()
                };
                L.fireEvent("beforepaste", S, Z);
                if (!S.html) {
                    return
                }
                Z = UE.htmlparser(S.html, true);
                if (L.queryCommandState("pasteplain") === 1) {
                    L.execCommand("insertHtml", UE.filterNode(Z, L.options.filterTxtRules).toHtml(), true)
                } else {
                    UE.filterNode(Z, L.options.filterTxtRules);
                    J = Z.toHtml();
                    M = S.html;
                    H = L.selection.getRange().createAddress(true);
                    L.execCommand("insertHtml", M, true)
                }
                L.fireEvent("afterpaste", S)
            }
        }
        L.addListener("pasteTransfer",
        function(P, Q) {
            if (H && J && M && J != M) {
                var V = L.selection.getRange();
                V.moveToAddress(H, true);
                if (!V.collapsed) {
                    while (!w.isBody(V.startContainer)) {
                        var O = V.startContainer;
                        if (O.nodeType == 1) {
                            O = O.childNodes[V.startOffset];
                            if (!O) {
                                V.setStartBefore(V.startContainer);
                                continue
                            }
                            var R = O.previousSibling;
                            if (R && R.nodeType == 3 && new RegExp("^[\n\r\t " + w.fillChar + "]*$").test(R.nodeValue)) {
                                V.setStartBefore(R)
                            }
                        }
                        if (V.startOffset == 0) {
                            V.setStartBefore(V.startContainer)
                        } else {
                            break
                        }
                    }
                    while (!w.isBody(V.endContainer)) {
                        var S = V.endContainer;
                        if (S.nodeType == 1) {
                            S = S.childNodes[V.endOffset];
                            if (!S) {
                                V.setEndAfter(V.endContainer);
                                continue
                            }
                            var T = S.nextSibling;
                            if (T && T.nodeType == 3 && new RegExp("^[\n\r\t" + w.fillChar + "]*$").test(T.nodeValue)) {
                                V.setEndAfter(T)
                            }
                        }
                        if (V.endOffset == V.endContainer.childNodes.length) {
                            V.setEndAfter(V.endContainer)
                        } else {
                            break
                        }
                    }
                }
                V.deleteContents();
                V.select(true);
                L.__hasEnterExecCommand = true;
                var U = M;
                if (Q === 2) {
                    U = U.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,
                    function(X, W, Z, Y) {
                        Z = Z.toLowerCase();
                        if ({
                            img: 1
                        } [Z]) {
                            return X
                        }
                        Y = Y.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,
                        function(ac, aa, ab) {
                            if ({
                                src: 1,
                                href: 1,
                                name: 1
                            } [aa.toLowerCase()]) {
                                return aa + "=" + ab + " "
                            }
                            return ""
                        });
                        if ({
                            span: 1,
                            div: 1
                        } [Z]) {
                            return ""
                        } else {
                            return "<" + W + Z + " " + C.trim(Y) + ">"
                        }
                    })
                } else {
                    if (Q) {
                        U = J
                    }
                }
                L.execCommand("inserthtml", U, true);
                L.__hasEnterExecCommand = false;
                var N = L.selection.getRange().createAddress(true);
                H.endAddress = N.startAddress
            }
        });
        L.addListener("ready",
        function() {
            w.on(L.body, "cut",
            function() {
                var N = L.selection.getRange();
                if (!N.collapsed && L.undoManger) {
                    L.undoManger.save()
                }
            });
            w.on(L.body, E.ie || E.opera ? "keydown": "paste",
            function(N) {
                if ((E.ie || E.opera) && ((!N.ctrlKey && !N.metaKey) || N.keyCode != "86")) {
                    return
                }
                K.call(L,
                function(O) {
                    I(O)
                })
            })
        })
    }; UE.plugins.list = function() {
        var P = this,
        J = null,
        K = {
            TD: 1,
            PRE: 1,
            BLOCKQUOTE: 1
        };
        var Q = {
            cn: "cn-1-",
            cn1: "cn-2-",
            cn2: "cn-3-",
            num: "num-1-",
            num1: "num-2-",
            num2: "num-3-",
            dash: "dash",
            dot: "dot"
        };
        P.setOpt({
            insertorderedlist: {
                num: "",
                num1: "",
                num2: "",
                cn: "",
                cn1: "",
                cn2: "",
                decimal: "",
                "lower-alpha": "",
                "lower-roman": "",
                "upper-alpha": "",
                "upper-roman": ""
            },
            insertunorderedlist: {
                circle: "",
                disc: "",
                square: "",
                dash: "",
                dot: ""
            },
            listDefaultPaddingLeft: "30",
            listiconpath: "http://bs.baidu.com/listicon/",
            maxListLevel: -1
        });
        function S(X) {
            var W = [];
            for (var Y in X) {
                W.push(Y)
            }
            return W
        }
        var R = {
            OL: S(P.options.insertorderedlist),
            UL: S(P.options.insertunorderedlist)
        };
        var I = P.options.listiconpath;
        for (var V in Q) {
            if (!P.options.insertorderedlist.hasOwnProperty(V) && !P.options.insertunorderedlist.hasOwnProperty(V)) {
                delete Q[V]
            }
        }
        P.ready(function() {
            var Y = [];
            for (var X in Q) {
                if (X == "dash" || X == "dot") {
                    Y.push("li.list-" + Q[X] + "{background-image:url(" + I + Q[X] + ".gif)}");
                    Y.push("ul.custom_" + X + "{list-style:none;}ul.custom_" + X + " li{background-position:0 3px;background-repeat:no-repeat}")
                } else {
                    for (var W = 0; W < 99; W++) {
                        Y.push("li.list-" + Q[X] + W + "{background-image:url(" + I + "list-" + Q[X] + W + ".gif)}")
                    }
                    Y.push("ol.custom_" + X + "{list-style:none;}ol.custom_" + X + " li{background-position:0 3px;background-repeat:no-repeat}")
                }
                switch (X) {
                    case "cn":
                        Y.push("li.list-" + X + "-paddingleft-1{padding-left:25px}");
                        Y.push("li.list-" + X + "-paddingleft-2{padding-left:40px}");
                        Y.push("li.list-" + X + "-paddingleft-3{padding-left:55px}");
                        break;
                    case "cn1":
                        Y.push("li.list-" + X + "-paddingleft-1{padding-left:30px}");
                        Y.push("li.list-" + X + "-paddingleft-2{padding-left:40px}");
                        Y.push("li.list-" + X + "-paddingleft-3{padding-left:55px}");
                        break;
                    case "cn2":
                        Y.push("li.list-" + X + "-paddingleft-1{padding-left:40px}");
                        Y.push("li.list-" + X + "-paddingleft-2{padding-left:55px}");
                        Y.push("li.list-" + X + "-paddingleft-3{padding-left:68px}");
                        break;
                    case "num":
                    case "num1":
                        Y.push("li.list-" + X + "-paddingleft-1{padding-left:25px}");
                        break;
                    case "num2":
                        Y.push("li.list-" + X + "-paddingleft-1{padding-left:35px}");
                        Y.push("li.list-" + X + "-paddingleft-2{padding-left:40px}");
                        break;
                    case "dash":
                        Y.push("li.list-" + X + "-paddingleft{padding-left:35px}");
                        break;
                    case "dot":
                        Y.push("li.list-" + X + "-paddingleft{padding-left:20px}")
                }
            }
            Y.push(".list-paddingleft-1{padding-left:0}");
            Y.push(".list-paddingleft-2{padding-left:" + P.options.listDefaultPaddingLeft + "px}");
            Y.push(".list-paddingleft-3{padding-left:" + P.options.listDefaultPaddingLeft * 2 + "px}");
            C.cssRule("list", "ol,ul{margin:0;pading:0;" + (E.ie ? "": "width:95%") + "}li{clear:both;}" + Y.join("\n"), P.document)
        });
        P.ready(function() {
            w.on(P.body, "cut",
            function() {
                setTimeout(function() {
                    var X = P.selection.getRange(),
                    W;
                    if (W = w.findParentByTagName(X.startContainer, "li", true)) {
                        if (!W.nextSibling && w.isEmptyBlock(W)) {
                            var Y = W.parentNode,
                            aa;
                            if (aa = Y.previousSibling) {
                                w.remove(Y);
                                X.setStartAtLast(aa).collapse(true);
                                X.select(true)
                            } else {
                                if (aa = Y.nextSibling) {
                                    w.remove(Y);
                                    X.setStartAtFirst(aa).collapse(true);
                                    X.select(true)
                                } else {
                                    var Z = P.document.createElement("p");
                                    w.fillNode(P.document, Z);
                                    Y.parentNode.insertBefore(Z, Y);
                                    w.remove(Y);
                                    X.setStart(Z, 0).collapse(true);
                                    X.select(true)
                                }
                            }
                        }
                    }
                })
            })
        });
        function O(X) {
            var W = X.className;
            if (w.hasClass(X, /custom_/)) {
                return W.match(/custom_(\w+)/)[1]
            }
            return w.getStyle(X, "list-style-type")
        }
        P.addListener("beforepaste",
        function(ab, aa) {
            var ac = this,
            Y = ac.selection.getRange(),
            W;
            var X = UE.htmlparser(aa.html, true);
            if (W = w.findParentByTagName(Y.startContainer, "li", true)) {
                var ad = W.parentNode,
                Z = ad.tagName == "OL" ? "ul": "ol";
                C.each(X.getNodesByTagName(Z),
                function(ah) {
                    ah.tagName = ad.tagName;
                    ah.setAttr();
                    if (ah.parentNode === X) {
                        ab = O(ad) || (ad.tagName == "OL" ? "decimal": "disc")
                    } else {
                        var ag = ah.parentNode.getAttr("class");
                        if (ag && /custom_/.test(ag)) {
                            ab = ag.match(/custom_(\w+)/)[1]
                        } else {
                            ab = ah.parentNode.getStyle("list-style-type")
                        }
                        if (!ab) {
                            ab = ad.tagName == "OL" ? "decimal": "disc"
                        }
                    }
                    var af = C.indexOf(R[ad.tagName], ab);
                    if (ah.parentNode !== X) {
                        af = af + 1 == R[ad.tagName].length ? 0 : af + 1
                    }
                    var ae = R[ad.tagName][af];
                    if (Q[ae]) {
                        ah.setAttr("class", "custom_" + ae)
                    } else {
                        ah.setStyle("list-style-type", ae)
                    }
                })
            }
            aa.html = X.toHtml()
        });
        P.addInputRule(function(Y) {
            C.each(Y.getNodesByTagName("li"),
            function(aa) {
                var ad = UE.uNode.createElement("p");
                for (var ac = 0,
                ab; ab = aa.children[ac];) {
                    if (ab.type == "text" || u.p[ab.tagName]) {
                        ad.appendChild(ab)
                    } else {
                        if (ad.firstChild()) {
                            aa.insertBefore(ad, ab);
                            ad = UE.uNode.createElement("p");
                            ac = ac + 2
                        } else {
                            ac++
                        }
                    }
                }
                if (ad.firstChild() && !ad.parentNode || !aa.firstChild()) {
                    aa.appendChild(ad)
                }
            });
            var X = {
                num1: /^\d+\)/,
                decimal: /^\d+\./,
                "lower-alpha": /^[a-z]+\)/,
                "upper-alpha": /^[A-Z]+\./,
                cn: /^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,
                cn2: /^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/
            },
            W = {
                square: "n"
            };
            function Z(ac, aa) {
                var ab = aa.firstChild();
                if (ab && ab.type == "element" && ab.tagName == "span" && /Wingdings|Symbol/.test(ab.getStyle("font-family"))) {
                    for (var ad in W) {
                        if (W[ad] == ab.data) {
                            return ad
                        }
                    }
                    return "disc"
                }
                for (var ad in X) {
                    if (X[ad].test(ac)) {
                        return ad
                    }
                }
            }
            C.each(Y.getNodesByTagName("p"),
            function(ad) {
                if (ad.getAttr("class") != "MsoListParagraph") {
                    return
                }
                ad.setAttr("class", "");
                function ab(ah, ai, ag) {
                    if (ah.tagName == "ol") {
                        ai.innerHTML(ai.innerHTML().replace(X[ag], ""))
                    } else {
                        ai.removeChild(ai.firstChild())
                    }
                    var af = UE.uNode.createElement("li");
                    af.appendChild(ai);
                    ah.appendChild(af)
                }
                var aa = ad,
                ac;
                if (ad.parentNode.tagName != "li" && (ac = Z(ad.innerText(), ad))) {
                    var ae = UE.uNode.createElement(P.options.insertorderedlist.hasOwnProperty(ac) ? "ol": "ul");
                    if (Q[ac]) {
                        ae.setAttr("class", "custom_" + ac)
                    } else {
                        ae.setStyle("list-style-type", ac)
                    }
                    while (ad && ad.parentNode.tagName != "li" && Z(ad.innerText(), ad)) {
                        aa = ad.nextSibling();
                        if (!aa) {
                            ad.parentNode.insertBefore(ae, ad)
                        }
                        ab(ae, ad, ac);
                        ad = aa
                    }
                    if (!ae.parentNode && ad && ad.parentNode) {
                        ad.parentNode.insertBefore(ae, ad)
                    }
                }
            })
        });
        P.addListener("contentchange",
        function() {
            N(P.document)
        });
        function N(W, X) {
            C.each(w.getElementsByTagName(W, "ol ul"),
            function(ae) {
                if (!w.inDoc(ae, W)) {
                    return
                }
                var ad = ae.parentNode;
                if (ad.tagName == ae.tagName) {
                    var Y = O(ae) || (ae.tagName == "OL" ? "decimal": "disc"),
                    aa = O(ad) || (ad.tagName == "OL" ? "decimal": "disc");
                    if (Y == aa) {
                        var af = C.indexOf(R[ae.tagName], Y);
                        af = af + 1 == R[ae.tagName].length ? 0 : af + 1;
                        U(ae, R[ae.tagName][af])
                    }
                }
                var Z = 0,
                ac = 2;
                if (w.hasClass(ae, /custom_/)) {
                    if (! (/[ou]l/i.test(ad.tagName) && w.hasClass(ad, /custom_/))) {
                        ac = 1
                    }
                } else {
                    if (/[ou]l/i.test(ad.tagName) && w.hasClass(ad, /custom_/)) {
                        ac = 3
                    }
                }
                var ab = w.getStyle(ae, "list-style-type");
                ab && (ae.style.cssText = "list-style-type:" + ab);
                ae.className = C.trim(ae.className.replace(/list-paddingleft-\w+/, "")) + " list-paddingleft-" + ac;
                C.each(w.getElementsByTagName(ae, "li"),
                function(ag) {
                    ag.style.cssText && (ag.style.cssText = "");
                    if (!ag.firstChild) {
                        w.remove(ag);
                        return
                    }
                    if (ag.parentNode !== ae) {
                        return
                    }
                    Z++;
                    if (w.hasClass(ae, /custom_/)) {
                        var ai = 1,
                        ah = O(ae);
                        if (ae.tagName == "OL") {
                            if (ah) {
                                switch (ah) {
                                    case "cn":
                                    case "cn1":
                                    case "cn2":
                                        if (Z > 10 && (Z % 10 == 0 || Z > 10 && Z < 20)) {
                                            ai = 2
                                        } else {
                                            if (Z > 20) {
                                                ai = 3
                                            }
                                        }
                                        break;
                                    case "num2":
                                        if (Z > 9) {
                                            ai = 2
                                        }
                                }
                            }
                            ag.className = "list-" + Q[ah] + Z + " list-" + ah + "-paddingleft-" + ai
                        } else {
                            ag.className = "list-" + Q[ah] + " list-" + ah + "-paddingleft"
                        }
                    } else {
                        ag.className = ag.className.replace(/list-[\w\-]+/gi, "")
                    }
                    var aj = ag.getAttribute("class");
                    if (aj !== null && !aj.replace(/\s/g, "")) {
                        w.removeAttributes(ag, "class")
                    }
                }); ! X && M(ae, ae.tagName.toLowerCase(), O(ae) || w.getStyle(ae, "list-style-type"), true)
            })
        }
        function M(ab, X, aa, Z) {
            var Y = ab.nextSibling;
            if (Y && Y.nodeType == 1 && Y.tagName.toLowerCase() == X && (O(Y) || w.getStyle(Y, "list-style-type") || (X == "ol" ? "decimal": "disc")) == aa) {
                w.moveChild(Y, ab);
                if (Y.childNodes.length == 0) {
                    w.remove(Y)
                }
            }
            if (Y && w.isFillChar(Y)) {
                w.remove(Y)
            }
            var W = ab.previousSibling;
            if (W && W.nodeType == 1 && W.tagName.toLowerCase() == X && (O(W) || w.getStyle(W, "list-style-type") || (X == "ol" ? "decimal": "disc")) == aa) {
                w.moveChild(ab, W)
            }
            if (W && w.isFillChar(W)) {
                w.remove(W)
            } ! Z && w.isEmptyBlock(ab) && w.remove(ab);
            if (O(ab)) {
                N(ab.ownerDocument, true)
            }
        }
        function U(X, W) {
            if (Q[W]) {
                X.className = "custom_" + W
            }
            try {
                w.setStyle(X, "list-style-type", W)
            } catch(Y) {}
        }
        function L(X) {
            var W = X.previousSibling;
            if (W && w.isEmptyBlock(W)) {
                w.remove(W)
            }
            W = X.nextSibling;
            if (W && w.isEmptyBlock(W)) {
                w.remove(W)
            }
        }
        function H() {
            if (J === null) {
                J = parseInt(g(P.body).css("lineHeight"), 10) + 5
            }
            P.body.scrollTop && (P.body.scrollTop += J)
        }
        P.addListener("keydown",
        function(X, al) {
            function ak(aq) {
                al.preventDefault ? al.preventDefault() : (al.returnValue = false);
                aq && H();
                P.fireEvent("contentchange");
                P.undoManger && P.undoManger.save()
            }
            function ae(aq, ar) {
                while (aq && !w.isBody(aq)) {
                    if (ar(aq)) {
                        return null
                    }
                    if (aq.nodeType == 1 && /[ou]l/i.test(aq.tagName)) {
                        return aq
                    }
                    aq = aq.parentNode
                }
                return null
            }
            var ac = al.keyCode || al.which;
            if (ac == 13 && !al.shiftKey) {
                var ab = P.selection.getRange(),
                ad = w.findParent(ab.startContainer,
                function(aq) {
                    return w.isBlockElm(aq)
                },
                true),
                ah = w.findParentByTagName(ab.startContainer, "li", true);
                if (ad && ad.tagName != "PRE" && !ah) {
                    var af = ad.innerHTML.replace(new RegExp(w.fillChar, "g"), "");
                    if (/^\s*1\s*\.[^\d]/.test(af)) {
                        ad.innerHTML = af.replace(/^\s*1\s*\./, "");
                        ab.setStartAtLast(ad).collapse(true).select();
                        P.__hasEnterExecCommand = true;
                        P.execCommand("insertorderedlist");
                        P.__hasEnterExecCommand = false
                    }
                }
                var aj = P.selection.getRange(),
                Z = ae(aj.startContainer,
                function(aq) {
                    return aq.tagName == "TABLE"
                }),
                Y = aj.collapsed ? Z: ae(aj.endContainer,
                function(aq) {
                    return aq.tagName == "TABLE"
                });
                if (Z && Y && Z === Y) {
                    if (!aj.collapsed) {
                        Z = w.findParentByTagName(aj.startContainer, "li", true);
                        Y = w.findParentByTagName(aj.endContainer, "li", true);
                        if (Z && Y && Z === Y) {
                            aj.deleteContents();
                            ah = w.findParentByTagName(aj.startContainer, "li", true);
                            if (ah && w.isEmptyBlock(ah)) {
                                am = ah.previousSibling;
                                next = ah.nextSibling;
                                an = P.document.createElement("p");
                                w.fillNode(P.document, an);
                                ai = ah.parentNode;
                                if (am && next) {
                                    aj.setStart(next, 0).collapse(true).select(true);
                                    w.remove(ah)
                                } else {
                                    if (!am && !next || !am) {
                                        ai.parentNode.insertBefore(an, ai)
                                    } else {
                                        ah.parentNode.parentNode.insertBefore(an, ai.nextSibling)
                                    }
                                    w.remove(ah);
                                    if (!ai.firstChild) {
                                        w.remove(ai)
                                    }
                                    aj.setStart(an, 0).setCursor()
                                }
                                ak();
                                return
                            }
                        } else {
                            var ap = aj.cloneRange(),
                            W = ap.collapse(false).createBookmark();
                            aj.deleteContents();
                            ap.moveToBookmark(W);
                            var ah = w.findParentByTagName(ap.startContainer, "li", true);
                            L(ah);
                            ap.select();
                            ak();
                            return
                        }
                    }
                    ah = w.findParentByTagName(aj.startContainer, "li", true);
                    if (ah) {
                        if (w.isEmptyBlock(ah)) {
                            W = aj.createBookmark();
                            var ai = ah.parentNode;
                            if (ah !== ai.lastChild) {
                                w.breakParent(ah, ai);
                                L(ah)
                            } else {
                                ai.parentNode.insertBefore(ah, ai.nextSibling);
                                if (w.isEmptyNode(ai)) {
                                    w.remove(ai)
                                }
                            }
                            if (!u.$list[ah.parentNode.tagName]) {
                                if (!w.isBlockElm(ah.firstChild)) {
                                    an = P.document.createElement("p");
                                    ah.parentNode.insertBefore(an, ah);
                                    while (ah.firstChild) {
                                        an.appendChild(ah.firstChild)
                                    }
                                    w.remove(ah)
                                } else {
                                    w.remove(ah, true)
                                }
                            }
                            aj.moveToBookmark(W).select()
                        } else {
                            var aa = ah.firstChild;
                            if (!aa || !w.isBlockElm(aa)) {
                                var an = P.document.createElement("p"); ! ah.firstChild && w.fillNode(P.document, an);
                                while (ah.firstChild) {
                                    an.appendChild(ah.firstChild)
                                }
                                ah.appendChild(an);
                                aa = an
                            }
                            var ao = P.document.createElement("span");
                            aj.insertNode(ao);
                            w.breakParent(ao, ah);
                            var ag = ao.nextSibling;
                            aa = ag.firstChild;
                            if (!aa) {
                                an = P.document.createElement("p");
                                w.fillNode(P.document, an);
                                ag.appendChild(an);
                                aa = an
                            }
                            if (w.isEmptyNode(aa)) {
                                aa.innerHTML = "";
                                w.fillNode(P.document, aa)
                            }
                            aj.setStart(aa, 0).collapse(true).shrinkBoundary().select();
                            w.remove(ao);
                            var am = ag.previousSibling;
                            if (am && w.isEmptyBlock(am)) {
                                am.innerHTML = "<p></p>";
                                w.fillNode(P.document, am.firstChild)
                            }
                        }
                        ak(true)
                    }
                }
            }
            if (ac == 8) {
                aj = P.selection.getRange();
                if (aj.collapsed && w.isStartInblock(aj)) {
                    ap = aj.cloneRange().trimBoundary();
                    ah = w.findParentByTagName(aj.startContainer, "li", true);
                    if (ah && w.isStartInblock(ap)) {
                        Z = w.findParentByTagName(aj.startContainer, "p", true);
                        if (Z && Z !== ah.firstChild) {
                            var ai = w.findParentByTagName(Z, ["ol", "ul"]);
                            w.breakParent(Z, ai);
                            L(Z);
                            P.fireEvent("contentchange");
                            aj.setStart(Z, 0).setCursor(false, true);
                            P.fireEvent("saveScene");
                            w.preventDefault(al);
                            return
                        }
                        if (ah && (am = ah.previousSibling)) {
                            if (ac == 46 && ah.childNodes.length) {
                                return
                            }
                            if (u.$list[am.tagName]) {
                                am = am.lastChild
                            }
                            P.undoManger && P.undoManger.save();
                            aa = ah.firstChild;
                            if (w.isBlockElm(aa)) {
                                if (w.isEmptyNode(aa)) {
                                    am.appendChild(aa);
                                    aj.setStart(aa, 0).setCursor(false, true);
                                    while (ah.firstChild) {
                                        am.appendChild(ah.firstChild)
                                    }
                                } else {
                                    ao = P.document.createElement("span");
                                    aj.insertNode(ao);
                                    if (w.isEmptyBlock(am)) {
                                        am.innerHTML = ""
                                    }
                                    w.moveChild(ah, am);
                                    aj.setStartBefore(ao).collapse(true).select(true);
                                    w.remove(ao)
                                }
                            } else {
                                if (w.isEmptyNode(ah)) {
                                    var an = P.document.createElement("p");
                                    am.appendChild(an);
                                    aj.setStart(an, 0).setCursor()
                                } else {
                                    aj.setEnd(am, am.childNodes.length).collapse().select(true);
                                    while (ah.firstChild) {
                                        am.appendChild(ah.firstChild)
                                    }
                                }
                            }
                            w.remove(ah);
                            P.fireEvent("contentchange");
                            P.fireEvent("saveScene");
                            w.preventDefault(al);
                            return
                        }
                        if (ah && !ah.previousSibling) {
                            var ai = ah.parentNode;
                            var W = aj.createBookmark();
                            if (w.isTagNode(ai.parentNode, "ol ul")) {
                                ai.parentNode.insertBefore(ah, ai);
                                if (w.isEmptyNode(ai)) {
                                    w.remove(ai)
                                }
                            } else {
                                while (ah.firstChild) {
                                    ai.parentNode.insertBefore(ah.firstChild, ai)
                                }
                                w.remove(ah);
                                if (w.isEmptyNode(ai)) {
                                    w.remove(ai)
                                }
                            }
                            aj.moveToBookmark(W).setCursor(false, true);
                            P.fireEvent("contentchange");
                            P.fireEvent("saveScene");
                            w.preventDefault(al);
                            return
                        }
                    }
                }
            }
        });
        P.addListener("keyup",
        function(Y, X) {
            var aa = X.keyCode || X.which;
            if (aa == 8) {
                var W = P.selection.getRange(),
                Z;
                if (Z = w.findParentByTagName(W.startContainer, ["ol", "ul"], true)) {
                    M(Z, Z.tagName.toLowerCase(), O(Z) || w.getComputedStyle(Z, "list-style-type"), true)
                }
            }
        });
        P.addListener("tabkeydown",
        function() {
            var ab = P.selection.getRange();
            function ah(ak) {
                if (P.options.maxListLevel != -1) {
                    var am = ak.parentNode,
                    al = 0;
                    while (/[ou]l/i.test(am.tagName)) {
                        al++;
                        am = am.parentNode
                    }
                    if (al >= P.options.maxListLevel) {
                        return true
                    }
                }
            }
            var ai = w.findParentByTagName(ab.startContainer, "li", true);
            if (ai) {
                var Z;
                if (ab.collapsed) {
                    if (ah(ai)) {
                        return true
                    }
                    var Y = ai.parentNode,
                    af = P.document.createElement(Y.tagName),
                    ac = C.indexOf(R[af.tagName], O(Y) || w.getComputedStyle(Y, "list-style-type"));
                    ac = ac + 1 == R[af.tagName].length ? 0 : ac + 1;
                    var X = R[af.tagName][ac];
                    U(af, X);
                    if (w.isStartInblock(ab)) {
                        P.fireEvent("saveScene");
                        Z = ab.createBookmark();
                        Y.insertBefore(af, ai);
                        af.appendChild(ai);
                        M(af, af.tagName.toLowerCase(), X);
                        P.fireEvent("contentchange");
                        ab.moveToBookmark(Z).select(true);
                        return true
                    }
                } else {
                    P.fireEvent("saveScene");
                    Z = ab.createBookmark();
                    for (var aa = 0,
                    W, ag = w.findParents(ai), aj; aj = ag[aa++];) {
                        if (w.isTagNode(aj, "ol ul")) {
                            W = aj;
                            break
                        }
                    }
                    var ae = ai;
                    if (Z.end) {
                        while (ae && !(w.getPosition(ae, Z.end) & w.POSITION_FOLLOWING)) {
                            if (ah(ae)) {
                                ae = w.getNextDomNode(ae, false, null,
                                function(ak) {
                                    return ak !== W
                                });
                                continue
                            }
                            var Y = ae.parentNode,
                            af = P.document.createElement(Y.tagName),
                            ac = C.indexOf(R[af.tagName], O(Y) || w.getComputedStyle(Y, "list-style-type"));
                            var ad = ac + 1 == R[af.tagName].length ? 0 : ac + 1;
                            var X = R[af.tagName][ad];
                            U(af, X);
                            Y.insertBefore(af, ae);
                            while (ae && !(w.getPosition(ae, Z.end) & w.POSITION_FOLLOWING)) {
                                ai = ae.nextSibling;
                                af.appendChild(ae);
                                if (!ai || w.isTagNode(ai, "ol ul")) {
                                    if (ai) {
                                        while (ai = ai.firstChild) {
                                            if (ai.tagName == "LI") {
                                                break
                                            }
                                        }
                                    } else {
                                        ai = w.getNextDomNode(ae, false, null,
                                        function(ak) {
                                            return ak !== W
                                        })
                                    }
                                    break
                                }
                                ae = ai
                            }
                            M(af, af.tagName.toLowerCase(), X);
                            ae = ai
                        }
                    }
                    P.fireEvent("contentchange");
                    ab.moveToBookmark(Z).select();
                    return true
                }
            }
        });
        function T(W) {
            while (W && !w.isBody(W)) {
                if (W.nodeName == "TABLE") {
                    return null
                }
                if (W.nodeName == "LI") {
                    return W
                }
                W = W.parentNode
            }
        }
        P.commands.insertorderedlist = P.commands.insertunorderedlist = {
            execCommand: function(aa, ar) {
                if (!ar) {
                    ar = aa.toLowerCase() == "insertorderedlist" ? "decimal": "disc"
                }
                var aA = this,
                ak = this.selection.getRange(),
                al = function(aD) {
                    return aD.nodeType == 1 ? aD.tagName.toLowerCase() != "br": !w.isWhitespace(aD)
                },
                aC = aa.toLowerCase() == "insertorderedlist" ? "ol": "ul",
                Z = aA.document.createDocumentFragment();
                ak.adjustmentBoundary().shrinkBoundary();
                var ae = ak.createBookmark(true),
                ac = T(aA.document.getElementById(ae.start)),
                ao = 0,
                ab = T(aA.document.getElementById(ae.end)),
                ap = 0,
                ay,
                ah,
                at,
                av;
                if (ac || ab) {
                    ac && (ay = ac.parentNode);
                    if (!ae.end) {
                        ab = ac
                    }
                    ab && (ah = ab.parentNode);
                    if (ay === ah) {
                        while (ac !== ab) {
                            av = ac;
                            ac = ac.nextSibling;
                            if (!w.isBlockElm(av.firstChild)) {
                                var am = aA.document.createElement("p");
                                while (av.firstChild) {
                                    am.appendChild(av.firstChild)
                                }
                                av.appendChild(am)
                            }
                            Z.appendChild(av)
                        }
                        av = aA.document.createElement("span");
                        ay.insertBefore(av, ab);
                        if (!w.isBlockElm(ab.firstChild)) {
                            am = aA.document.createElement("p");
                            while (ab.firstChild) {
                                am.appendChild(ab.firstChild)
                            }
                            ab.appendChild(am)
                        }
                        Z.appendChild(ab);
                        w.breakParent(av, ay);
                        if (w.isEmptyNode(av.previousSibling)) {
                            w.remove(av.previousSibling)
                        }
                        if (w.isEmptyNode(av.nextSibling)) {
                            w.remove(av.nextSibling)
                        }
                        var ad = O(ay) || w.getComputedStyle(ay, "list-style-type") || (aa.toLowerCase() == "insertorderedlist" ? "decimal": "disc");
                        if (ay.tagName.toLowerCase() == aC && ad == ar) {
                            for (var aq = 0,
                            ai, af = aA.document.createDocumentFragment(); ai = Z.childNodes[aq++];) {
                                if (w.isTagNode(ai, "ol ul")) {
                                    C.each(w.getElementsByTagName(ai, "li"),
                                    function(aD) {
                                        while (aD.firstChild) {
                                            af.appendChild(aD.firstChild)
                                        }
                                    })
                                } else {
                                    while (ai.firstChild) {
                                        af.appendChild(ai.firstChild)
                                    }
                                }
                            }
                            av.parentNode.insertBefore(af, av)
                        } else {
                            at = aA.document.createElement(aC);
                            U(at, ar);
                            at.appendChild(Z);
                            av.parentNode.insertBefore(at, av)
                        }
                        w.remove(av);
                        at && M(at, aC, ar);
                        ak.moveToBookmark(ae).select();
                        return
                    }
                    if (ac) {
                        while (ac) {
                            av = ac.nextSibling;
                            if (w.isTagNode(ac, "ol ul")) {
                                Z.appendChild(ac)
                            } else {
                                var X = aA.document.createDocumentFragment(),
                                ax = 0;
                                while (ac.firstChild) {
                                    if (w.isBlockElm(ac.firstChild)) {
                                        ax = 1
                                    }
                                    X.appendChild(ac.firstChild)
                                }
                                if (!ax) {
                                    var aB = aA.document.createElement("p");
                                    aB.appendChild(X);
                                    Z.appendChild(aB)
                                } else {
                                    Z.appendChild(X)
                                }
                                w.remove(ac)
                            }
                            ac = av
                        }
                        ay.parentNode.insertBefore(Z, ay.nextSibling);
                        if (w.isEmptyNode(ay)) {
                            ak.setStartBefore(ay);
                            w.remove(ay)
                        } else {
                            ak.setStartAfter(ay)
                        }
                        ao = 1
                    }
                    if (ab && w.inDoc(ah, aA.document)) {
                        ac = ah.firstChild;
                        while (ac && ac !== ab) {
                            av = ac.nextSibling;
                            if (w.isTagNode(ac, "ol ul")) {
                                Z.appendChild(ac)
                            } else {
                                X = aA.document.createDocumentFragment();
                                ax = 0;
                                while (ac.firstChild) {
                                    if (w.isBlockElm(ac.firstChild)) {
                                        ax = 1
                                    }
                                    X.appendChild(ac.firstChild)
                                }
                                if (!ax) {
                                    aB = aA.document.createElement("p");
                                    aB.appendChild(X);
                                    Z.appendChild(aB)
                                } else {
                                    Z.appendChild(X)
                                }
                                w.remove(ac)
                            }
                            ac = av
                        }
                        var W = w.createElement(aA.document, "div", {
                            tmpDiv: 1
                        });
                        w.moveChild(ab, W);
                        Z.appendChild(W);
                        w.remove(ab);
                        ah.parentNode.insertBefore(Z, ah);
                        ak.setEndBefore(ah);
                        if (w.isEmptyNode(ah)) {
                            w.remove(ah)
                        }
                        ap = 1
                    }
                }
                if (!ao) {
                    ak.setStartBefore(aA.document.getElementById(ae.start))
                }
                if (ae.end && !ap) {
                    ak.setEndAfter(aA.document.getElementById(ae.end))
                }
                ak.enlarge(true,
                function(aD) {
                    return K[aD.tagName]
                });
                Z = aA.document.createDocumentFragment();
                var Y = ak.createBookmark(),
                an = w.getNextDomNode(Y.start, false, al),
                az = ak.cloneRange(),
                au,
                ag = w.isBlockElm;
                while (an && an !== Y.end && (w.getPosition(an, Y.end) & w.POSITION_PRECEDING)) {
                    if (an.nodeType == 3 || u.li[an.tagName]) {
                        if (an.nodeType == 1 && u.$list[an.tagName]) {
                            while (an.firstChild) {
                                Z.appendChild(an.firstChild)
                            }
                            au = w.getNextDomNode(an, false, al);
                            w.remove(an);
                            an = au;
                            continue
                        }
                        au = an;
                        az.setStartBefore(an);
                        while (an && an !== Y.end && (!ag(an) || w.isBookmarkNode(an))) {
                            au = an;
                            an = w.getNextDomNode(an, false, null,
                            function(aD) {
                                return ! K[aD.tagName]
                            })
                        }
                        if (an && ag(an)) {
                            if (an.style.textIndent) {
                                an.style.textIndent = ""
                            }
                            av = w.getNextDomNode(au, false, al);
                            if (av && w.isBookmarkNode(av)) {
                                an = w.getNextDomNode(av, false, al);
                                au = av
                            }
                        }
                        az.setEndAfter(au);
                        an = w.getNextDomNode(au, false, al);
                        var aj = ak.document.createElement("li");
                        aj.appendChild(az.extractContents());
                        if (w.isEmptyNode(aj)) {
                            var au = ak.document.createElement("p");
                            while (aj.firstChild) {
                                au.appendChild(aj.firstChild)
                            }
                            aj.appendChild(au)
                        }
                        Z.appendChild(aj)
                    } else {
                        an = w.getNextDomNode(an, true, al)
                    }
                }
                ak.moveToBookmark(Y).collapse(true);
                at = aA.document.createElement(aC);
                U(at, ar);
                at.appendChild(Z);
                ak.insertNode(at);
                M(at, aC, ar);
                for (var aq = 0,
                ai, aw = w.getElementsByTagName(at, "div"); ai = aw[aq++];) {
                    if (ai.getAttribute("tmpDiv")) {
                        w.remove(ai, true)
                    }
                }
                ak.moveToBookmark(ae).select()
            },
            queryCommandState: function(aa) {
                var W = aa.toLowerCase() == "insertorderedlist" ? "ol": "ul";
                var Z = this.selection.getStartElementPath();
                for (var Y = 0,
                X; X = Z[Y++];) {
                    if (X.nodeName == "TABLE") {
                        return 0
                    }
                    if (W == X.nodeName.toLowerCase()) {
                        return 1
                    }
                }
                return 0
            },
            queryCommandValue: function(ab) {
                var W = ab.toLowerCase() == "insertorderedlist" ? "ol": "ul";
                var aa = this.selection.getStartElementPath(),
                Z;
                for (var Y = 0,
                X; X = aa[Y++];) {
                    if (X.nodeName == "TABLE") {
                        Z = null;
                        break
                    }
                    if (W == X.nodeName.toLowerCase()) {
                        Z = X;
                        break
                    }
                }
                return Z ? O(Z) || w.getComputedStyle(Z, "list-style-type") : null
            }
        }
    }; UE.plugins.attachLoader = function() {
        var K = this,
        J = 0;
        this.addListener("ready",
        function() {
            K.options.wangpanLoaderJs && I(K.options.wangpanLoaderJs, H)
        });
        function I(L, M) {
            UE.utils.loadFile(document, {
                src: L,
                tag: "script",
                type: "text/javascript",
                defer: "defer"
            },
            function() {
                J++;
                M && M()
            })
        }
        function H() {
            if (J === 1) {
                UE.AttachResourceReady = true;
                K.fireEvent("attachresourceready")
            }
        }
    }; UE.plugins.enterkey = function() {
        var I, J = this,
        H = J.options.enterTag;
        J.addListener("keyup",
        function(R, S) {
            var T = S.keyCode || S.which;
            if (T == 13) {
                var Q = J.selection.getRange(),
                N = Q.startContainer,
                K;
                if (!E.ie) {
                    if (/h\d/i.test(I)) {
                        if (E.gecko) {
                            var P = w.findParentByTagName(N, ["h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "caption", "table"], true);
                            if (!P) {
                                J.document.execCommand("formatBlock", false, "<p>");
                                K = 1
                            }
                        } else {
                            if (N.nodeType == 1) {
                                var O = J.document.createTextNode(""),
                                L;
                                Q.insertNode(O);
                                L = w.findParentByTagName(O, "div", true);
                                if (L) {
                                    var M = J.document.createElement("p");
                                    while (L.firstChild) {
                                        M.appendChild(L.firstChild)
                                    }
                                    L.parentNode.insertBefore(M, L);
                                    w.remove(L);
                                    Q.setStartBefore(O).setCursor();
                                    K = 1
                                }
                                w.remove(O)
                            }
                        }
                        if (J.undoManger && K) {
                            J.undoManger.save()
                        }
                    }
                    E.opera && Q.select()
                } else {
                    J.fireEvent("saveScene", true, true)
                }
            }
        });
        J.addListener("keydown",
        function(P, R) {
            var T = R.keyCode || R.which;
            if (T == 13) {
                if (J.fireEvent("beforeenterkeydown")) {
                    w.preventDefault(R);
                    return
                }
                J.fireEvent("saveScene", true, true);
                I = "";
                var M = J.selection.getRange();
                if (!M.collapsed) {
                    var K = M.startContainer,
                    L = M.endContainer,
                    N = w.findParentByTagName(K, "td", true),
                    O = w.findParentByTagName(L, "td", true);
                    if (N && O && N !== O || !N && O || N && !O) {
                        R.preventDefault ? R.preventDefault() : (R.returnValue = false);
                        return
                    }
                }
                if (H == "p") {
                    if (!E.ie) {
                        K = w.findParentByTagName(M.startContainer, ["ol", "ul", "p", "h1", "h2", "h3", "h4", "h5", "h6", "blockquote", "caption"], true);
                        if (!K && !E.opera) {
                            J.document.execCommand("formatBlock", false, "<p>");
                            if (E.gecko) {
                                M = J.selection.getRange();
                                K = w.findParentByTagName(M.startContainer, "p", true);
                                K && w.removeDirtyAttr(K)
                            }
                        } else {
                            I = K.tagName;
                            K.tagName.toLowerCase() == "p" && E.gecko && w.removeDirtyAttr(K)
                        }
                    }
                } else {
                    R.preventDefault ? R.preventDefault() : (R.returnValue = false);
                    if (!M.collapsed) {
                        M.deleteContents();
                        K = M.startContainer;
                        if (K.nodeType == 1 && (K = K.childNodes[M.startOffset])) {
                            while (K.nodeType == 1) {
                                if (u.$empty[K.tagName]) {
                                    M.setStartBefore(K).setCursor();
                                    if (J.undoManger) {
                                        J.undoManger.save()
                                    }
                                    return false
                                }
                                if (!K.firstChild) {
                                    var S = M.document.createElement("br");
                                    K.appendChild(S);
                                    M.setStart(K, 0).setCursor();
                                    if (J.undoManger) {
                                        J.undoManger.save()
                                    }
                                    return false
                                }
                                K = K.firstChild
                            }
                            if (K === M.startContainer.childNodes[M.startOffset]) {
                                S = M.document.createElement("br");
                                M.insertNode(S).setCursor()
                            } else {
                                M.setStart(K, 0).setCursor()
                            }
                        } else {
                            S = M.document.createElement("br");
                            M.insertNode(S).setStartAfter(S).setCursor()
                        }
                    } else {
                        S = M.document.createElement("br");
                        M.insertNode(S);
                        var Q = S.parentNode;
                        if (Q.lastChild === S) {
                            S.parentNode.insertBefore(S.cloneNode(true), S);
                            M.setStartBefore(S)
                        } else {
                            M.setStartAfter(S)
                        }
                        M.setCursor()
                    }
                }
            }
        })
    }; UE.plugins.keystrokes = function() {
        var I = this;
        var J = true,
        H = null;
        I.addListener("keydown",
        function(M, X) {
            var R = X.keyCode || X.which,
            P = I.selection.getRange();
            if (!P.collapsed && !(X.ctrlKey || X.shiftKey || X.altKey || X.metaKey) && (R >= 65 && R <= 90 || R >= 48 && R <= 57 || R >= 96 && R <= 111 || {
                13 : 1,
                8 : 1,
                46 : 1
            } [R])) {
                var ae = P.startContainer;
                if (w.isFillChar(ae)) {
                    P.setStartBefore(ae)
                }
                ae = P.endContainer;
                if (w.isFillChar(ae)) {
                    P.setEndAfter(ae)
                }
                P.txtToElmBoundary();
                if (P.endContainer && P.endContainer.nodeType == 1) {
                    ae = P.endContainer.childNodes[P.endOffset];
                    if (ae && w.isBr(ae)) {
                        P.setEndAfter(ae)
                    }
                }
                if (P.startOffset == 0) {
                    ae = P.startContainer;
                    if (w.isBoundaryNode(ae, "firstChild")) {
                        ae = P.endContainer;
                        if (P.endOffset == (ae.nodeType == 3 ? ae.nodeValue.length: ae.childNodes.length) && w.isBoundaryNode(ae, "lastChild")) {
                            I.fireEvent("saveScene");
                            I.body.innerHTML = "<p>" + (E.ie ? "": "<br/>") + "</p>";
                            P.setStart(I.body.firstChild, 0).setCursor(false, true);
                            I._selectionChange();
                            return
                        }
                    }
                }
            }
            if (R == 8) {
                P = I.selection.getRange();
                J = P.collapsed;
                var O, N;
                if (P.collapsed && P.inFillChar()) {
                    O = P.startContainer;
                    if (w.isFillChar(O)) {
                        P.setStartBefore(O).shrinkBoundary(true).collapse(true);
                        w.remove(O)
                    } else {
                        O.nodeValue = O.nodeValue.replace(new RegExp("^" + w.fillChar), "");
                        P.startOffset--;
                        P.collapse(true).select(true)
                    }
                }
                if (O = P.getClosedNode()) {
                    I.fireEvent("saveScene");
                    P.setStartBefore(O);
                    w.remove(O);
                    P.setCursor();
                    I.fireEvent("saveScene");
                    w.preventDefault(X);
                    return
                }
                if (!E.ie) {
                    O = w.findParentByTagName(P.startContainer, "table", true);
                    N = w.findParentByTagName(P.endContainer, "table", true);
                    if (O && !N || !O && N || O !== N) {
                        X.preventDefault();
                        return
                    }
                }
                O = P.startContainer;
                var L = w.findParentByTagName(O, "pre", true);
                if (L && w.isEmptyNode(L)) {
                    w.remove(L)
                }
                O = P.startContainer;
                var K = w.findParentByTagName(O, "p", true);
                L = K && K.previousSibling;
                if (L && L.tagName.toLowerCase() === "pre") {
                    H = L
                }
            }
            if (R == 9) {
                var S = {
                    ol: 1,
                    ul: 1,
                    table: 1
                };
                if (I.fireEvent("tabkeydown", X)) {
                    w.preventDefault(X);
                    return
                }
                var U = I.selection.getRange();
                I.fireEvent("saveScene");
                for (var ad = 0,
                V = "",
                Y = I.options.tabSize || 4,
                ab = I.options.tabNode || "&nbsp;"; ad < Y; ad++) {
                    V += ab
                }
                var ac = I.document.createElement("span");
                ac.innerHTML = V + w.fillChar;
                if (U.collapsed) {
                    U.insertNode(ac.cloneNode(true).firstChild).setCursor(true)
                } else {
                    O = w.findParent(U.startContainer, W);
                    N = w.findParent(U.endContainer, W);
                    if (O && N && O === N) {
                        U.deleteContents();
                        U.insertNode(ac.cloneNode(true).firstChild).setCursor(true)
                    } else {
                        var Q = U.createBookmark(),
                        W = function(af) {
                            return w.isBlockElm(af) && !S[af.tagName.toLowerCase()]
                        };
                        U.enlarge(true);
                        var aa = U.createBookmark(),
                        Z = w.getNextDomNode(aa.start, false, W);
                        while (Z && !(w.getPosition(Z, aa.end) & w.POSITION_FOLLOWING)) {
                            Z.insertBefore(ac.cloneNode(true).firstChild, Z.firstChild);
                            Z = w.getNextDomNode(Z, false, W)
                        }
                        U.moveToBookmark(aa).moveToBookmark(Q).select()
                    }
                }
                w.preventDefault(X)
            }
            if (E.gecko && R == 46) {
                U = I.selection.getRange();
                if (U.collapsed) {
                    O = U.startContainer;
                    if (w.isEmptyBlock(O)) {
                        var T = O.parentNode;
                        while (w.getChildCount(T) == 1 && !w.isBody(T)) {
                            O = T;
                            T = T.parentNode
                        }
                        if (O === T.lastChild) {
                            X.preventDefault()
                        }
                        return
                    }
                }
            }
        });
        I.addListener("keyup",
        function(P, S) {
            var U = S.keyCode || S.which,
            K, O = this;
            if (U == 8) {
                if (H && H.parentNode) {
                    if (!H.nextSibling || H.nextSibling.tagName.toLowerCase() !== "p") {
                        var R = document.createElement("p");
                        R.innerHTML = w.fillChar + "<br>";
                        w.insertAfter(H, R)
                    }
                    H = null
                }
                if (O.fireEvent("delkeyup")) {
                    return
                }
                K = O.selection.getRange();
                if (K.collapsed) {
                    var L, T = ["h1", "h2", "h3", "h4", "h5", "h6"];
                    if (L = w.findParentByTagName(K.startContainer, T, true)) {
                        if (w.isEmptyBlock(L)) {
                            var M = L.previousSibling;
                            if (M && M.nodeName != "TABLE") {
                                w.remove(L);
                                K.setStartAtLast(M).setCursor(false, true);
                                return
                            } else {
                                var N = L.nextSibling;
                                if (N && N.nodeName != "TABLE") {
                                    w.remove(L);
                                    K.setStartAtFirst(N).setCursor(false, true);
                                    return
                                }
                            }
                        }
                    }
                    if (w.isBody(K.startContainer)) {
                        var L = w.createElement(O.document, "p", {
                            innerHTML: E.ie ? w.fillChar: "<br/>"
                        });
                        K.insertNode(L).setStart(L, 0).setCursor(false, true)
                    }
                }
                if (!J && (K.startContainer.nodeType == 3 || K.startContainer.nodeType == 1 && w.isEmptyBlock(K.startContainer))) {
                    if (E.ie) {
                        var Q = K.document.createElement("span");
                        K.insertNode(Q).setStartBefore(Q).collapse(true);
                        K.select();
                        w.remove(Q)
                    } else {
                        K.select()
                    }
                }
            }
        })
    }; UE.plugins.fiximgclick = function() {
        var H = this;
        if (E.webkit) {
            H.addListener("click",
            function(J, K) {
                if (K.target.tagName == "IMG") {
                    var I = new y.Range(H.document);
                    I.selectNode(K.target).select()
                }
            })
        }
    }; UE.plugins.pasteplain = function() {
        var I = this;
        I.setOpt({
            pasteplain: false,
            filterTxtRules: function() {
                function J(K) {
                    K.tagName = "p";
                    K.setStyle()
                }
                return {
                    "-": "script style object iframe embed input select",
                    p: {
                        $: {}
                    },
                    br: {
                        $: {}
                    },
                    div: function(L) {
                        var K, M = UE.uNode.createElement("p");
                        while (K = L.firstChild()) {
                            if (K.type == "text" || !UE.dom.dtd.$block[K.tagName]) {
                                M.appendChild(K)
                            } else {
                                if (M.firstChild()) {
                                    L.parentNode.insertBefore(M, L);
                                    M = UE.uNode.createElement("p")
                                } else {
                                    L.parentNode.insertBefore(K, L)
                                }
                            }
                        }
                        if (M.firstChild()) {
                            L.parentNode.insertBefore(M, L)
                        }
                        L.parentNode.removeChild(L)
                    },
                    ol: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    ul: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    dl: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    dt: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    dd: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    li: function(K) {
                        K.parentNode.removeChild(K, true)
                    },
                    caption: J,
                    th: J,
                    tr: J,
                    h1: J,
                    h2: J,
                    h3: J,
                    h4: J,
                    h5: J,
                    h6: J,
                    td: function(L) {
                        var K = !!L.innerText();
                        if (K) {
                            L.parentNode.insertAfter(UE.uNode.createText(" &nbsp; &nbsp;"), L)
                        }
                        L.parentNode.removeChild(L, L.innerText())
                    }
                }
            } ()
        });
        var H = I.options.pasteplain;
        I.commands.pasteplain = {
            queryCommandState: function() {
                return H ? 1 : 0
            },
            execCommand: function() {
                H = !H | 0
            },
            notNeedUndo: 1
        }
    }; UE.plugins.insertcode = function() {
        var I = this;
        I.ready(function() {
            C.cssRule("pre", "pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;line-height:1.5}", I.document)
        });
        I.setOpt("insertcode", {
            as3: "ActionScript3",
            bash: "Bash/Shell",
            cpp: "C/C++",
            css: "Css",
            cf: "CodeFunction",
            "c#": "C#",
            delphi: "Delphi",
            diff: "Diff",
            erlang: "Erlang",
            groovy: "Groovy",
            html: "Html",
            java: "Java",
            jfx: "JavaFx",
            js: "Javascript",
            pl: "Perl",
            php: "Php",
            plain: "Plain Text",
            ps: "PowerShell",
            python: "Python",
            ruby: "Ruby",
            scala: "Scala",
            sql: "Sql",
            vb: "Vb",
            xml: "Xml"
        });
        I.commands.insertcode = {
            execCommand: function(O, M) {
                var Q = this,
                J = Q.selection.getRange(),
                P = w.findParentByTagName(J.startContainer, "pre", true);
                if (P) {
                    P.className = "brush:" + M + ";toolbar:false;"
                } else {
                    var L = "";
                    if (J.collapsed) {
                        L = E.ie ? (E.version > 8 ? "": "&nbsp;") : "<br/>"
                    } else {
                        var R = J.extractContents();
                        var K = Q.document.createElement("div");
                        K.appendChild(R);
                        C.each(UE.filterNode(UE.htmlparser(K.innerHTML.replace(/[\r\t]/g, "")), Q.options.filterTxtRules).children,
                        function(S) {
                            if (E.ie && E.version > 8) {
                                if (S.type == "element") {
                                    if (S.tagName == "br") {
                                        L += "\n"
                                    } else {
                                        if (!u.$empty[S.tagName]) {
                                            C.each(S.children,
                                            function(T) {
                                                if (T.type == "element") {
                                                    if (T.tagName == "br") {
                                                        L += "\n"
                                                    } else {
                                                        if (!u.$empty[S.tagName]) {
                                                            L += T.innerText()
                                                        }
                                                    }
                                                } else {
                                                    L += T.data
                                                }
                                            });
                                            if (!/\n$/.test(L)) {
                                                L += "\n"
                                            }
                                        }
                                    }
                                } else {
                                    L += S.data + "\n"
                                }
                                if (!S.nextSibling() && /\n$/.test(L)) {
                                    L = L.replace(/\n$/, "")
                                }
                            } else {
                                if (E.ie) {
                                    if (S.type == "element") {
                                        if (S.tagName == "br") {
                                            L += "<br>"
                                        } else {
                                            if (!u.$empty[S.tagName]) {
                                                C.each(S.children,
                                                function(T) {
                                                    if (T.type == "element") {
                                                        if (T.tagName == "br") {
                                                            L += "<br>"
                                                        } else {
                                                            if (!u.$empty[S.tagName]) {
                                                                L += T.innerText()
                                                            }
                                                        }
                                                    } else {
                                                        L += T.data
                                                    }
                                                });
                                                if (!/br>$/.test(L)) {
                                                    L += "<br>"
                                                }
                                            }
                                        }
                                    } else {
                                        L += S.data + "<br>"
                                    }
                                    if (!S.nextSibling() && /<br>$/.test(L)) {
                                        L = L.replace(/<br>$/, "")
                                    }
                                } else {
                                    L += (S.type == "element" ? (u.$empty[S.tagName] ? "": S.innerText()) : S.data);
                                    if (!/br\/?\s*>$/.test(L)) {
                                        if (!S.nextSibling()) {
                                            return
                                        }
                                        L += "<br>"
                                    }
                                }
                            }
                        })
                    }
                    Q.execCommand("inserthtml", '<pre id="coder"class="brush:' + M + ';toolbar:false">' + L + "</pre>", true);
                    P = Q.document.getElementById("coder");
                    w.removeAttributes(P, "id");
                    var N = P.previousSibling;
                    if (N && w.isEmptyBlock(N)) {
                        w.remove(N)
                    }
                    var J = Q.selection.getRange();
                    if (w.isEmptyBlock(P)) {
                        J.setStart(P, 0).setCursor(false, true)
                    } else {
                        J.selectNodeContents(P).select()
                    }
                }
            },
            queryCommandValue: function() {
                var J = this.selection.getStartElementPath();
                var K = "";
                C.each(J,
                function(M) {
                    if (M.nodeName == "PRE") {
                        var L = M.className.match(/brush:([^;]+)/);
                        K = L && L[1] ? L[1] : "";
                        return false
                    }
                });
                return K
            }
        };
        I.addInputRule(function(J) {
            C.each(J.getNodesByTagName("pre"),
            function(M) {
                var L = M.getNodesByTagName("br");
                if (L.length) {
                    E.ie && E.version > 8 && C.each(L,
                    function(O) {
                        var N = UE.uNode.createText("\n");
                        O.parentNode.insertBefore(N, O);
                        O.parentNode.removeChild(O)
                    });
                    return
                }
                if (E.ie && E.version > 8) {
                    return
                }
                var K = M.innerText().split(/\n/);
                M.innerHTML("");
                C.each(K,
                function(N) {
                    if (N.length) {
                        M.appendChild(UE.uNode.createText(N))
                    }
                    M.appendChild(UE.uNode.createElement("br"))
                })
            })
        });
        I.addOutputRule(function(J) {
            C.each(J.getNodesByTagName("pre"),
            function(L) {
                var K = "";
                C.each(L.children,
                function(M) {
                    if (M.type == "text") {
                        K += M.data.replace(/[ ]/g, "&nbsp;")
                    } else {
                        K += "\n"
                    }
                });
                L.innerText(K.replace(/(&nbsp;|\n)+$/, ""))
            })
        });
        I.notNeedCodeQuery = {
            help: 1,
            undo: 1,
            redo: 1,
            source: 1,
            print: 1,
            searchreplace: 1,
            fullscreen: 1,
            preview: 1,
            insertparagraph: 1,
            elementpath: 1,
            highlightcode: 1,
            insertcode: 1,
            inserthtml: 1,
            selectall: 1
        };
        var H = I.queryCommandState;
        I.queryCommandState = function(K) {
            var J = this;
            if (!J.notNeedCodeQuery[K.toLowerCase()] && J.selection && J.queryCommandValue("insertcode")) {
                return - 1
            }
            return UE.Editor.prototype.queryCommandState.apply(this, arguments)
        };
        I.addListener("beforeenterkeydown",
        function() {
            var J = I.selection.getRange();
            var M = w.findParentByTagName(J.startContainer, "pre", true);
            if (M) {
                I.fireEvent("saveScene");
                if (!J.collapsed) {
                    J.deleteContents()
                }
                if (!E.ie) {
                    var L = I.document.createElement("br"),
                    M;
                    J.insertNode(L).setStartAfter(L).collapse(true);
                    var R = L.nextSibling;
                    if (!R) {
                        J.insertNode(L.cloneNode(false))
                    } else {
                        J.setStartAfter(L)
                    }
                    M = L.previousSibling;
                    var O;
                    while (M) {
                        O = M;
                        M = M.previousSibling;
                        if (!M || M.nodeName == "BR") {
                            M = O;
                            break
                        }
                    }
                    if (M) {
                        var T = "";
                        while (M && M.nodeName != "BR" && new RegExp("^[\\s" + w.fillChar + "]*$").test(M.nodeValue)) {
                            T += M.nodeValue;
                            M = M.nextSibling
                        }
                        if (M.nodeName != "BR") {
                            var S = M.nodeValue.match(new RegExp("^([\\s" + w.fillChar + "]+)"));
                            if (S && S[1]) {
                                T += S[1]
                            }
                        }
                        if (T) {
                            T = I.document.createTextNode(T);
                            J.insertNode(T).setStartAfter(T)
                        }
                    }
                    J.collapse(true).select(true)
                } else {
                    if (E.version > 8) {
                        var P = I.document.createTextNode("\n");
                        var K = J.startContainer;
                        if (J.startOffset == 0) {
                            var Q = K.previousSibling;
                            if (Q) {
                                J.insertNode(P);
                                var N = I.document.createTextNode(" ");
                                J.setStartAfter(P).insertNode(N).setStart(N, 0).collapse(true).select(true)
                            }
                        } else {
                            J.insertNode(P).setStartAfter(P);
                            var N = I.document.createTextNode(" ");
                            K = J.startContainer.childNodes[J.startOffset];
                            if (K && !/^\n/.test(K.nodeValue)) {
                                J.setStartBefore(P)
                            }
                            J.insertNode(N).setStart(N, 0).collapse(true).select(true)
                        }
                    } else {
                        var L = I.document.createElement("br");
                        J.insertNode(L);
                        J.insertNode(I.document.createTextNode(w.fillChar));
                        J.setStartAfter(L);
                        M = L.previousSibling;
                        var O;
                        while (M) {
                            O = M;
                            M = M.previousSibling;
                            if (!M || M.nodeName == "BR") {
                                M = O;
                                break
                            }
                        }
                        if (M) {
                            var T = "";
                            while (M && M.nodeName != "BR" && new RegExp("^[ " + w.fillChar + "]*$").test(M.nodeValue)) {
                                T += M.nodeValue;
                                M = M.nextSibling
                            }
                            if (M.nodeName != "BR") {
                                var S = M.nodeValue.match(new RegExp("^([ " + w.fillChar + "]+)"));
                                if (S && S[1]) {
                                    T += S[1]
                                }
                            }
                            T = I.document.createTextNode(T);
                            J.insertNode(T).setStartAfter(T)
                        }
                        J.collapse(true).select()
                    }
                }
                I.fireEvent("saveScene");
                return true
            }
        });
        I.addListener("tabkeydown",
        function(O, M) {
            var L = I.selection.getRange();
            var P = w.findParentByTagName(L.startContainer, "pre", true);
            if (P) {
                I.fireEvent("saveScene");
                if (M.shiftKey) {} else {
                    if (!L.collapsed) {
                        var J = L.createBookmark();
                        var Q = J.start.previousSibling;
                        while (Q) {
                            if (P.firstChild === Q && !w.isBr(Q)) {
                                P.insertBefore(I.document.createTextNode("    "), Q);
                                break
                            }
                            if (w.isBr(Q)) {
                                P.insertBefore(I.document.createTextNode("    "), Q.nextSibling);
                                break
                            }
                            Q = Q.previousSibling
                        }
                        var K = J.end;
                        Q = J.start.nextSibling;
                        if (P.firstChild === J.start) {
                            P.insertBefore(I.document.createTextNode("    "), Q.nextSibling)
                        }
                        while (Q && Q !== K) {
                            if (w.isBr(Q) && Q.nextSibling) {
                                if (Q.nextSibling === K) {
                                    break
                                }
                                P.insertBefore(I.document.createTextNode("    "), Q.nextSibling)
                            }
                            Q = Q.nextSibling
                        }
                        L.moveToBookmark(J).select()
                    } else {
                        var N = I.document.createTextNode("    ");
                        L.insertNode(N).setStartAfter(N).collapse(true).select(true)
                    }
                }
                I.fireEvent("saveScene");
                return true
            }
        });
        I.addListener("beforeinserthtml",
        function(P, L) {
            var N = this,
            J = N.selection.getRange(),
            O = w.findParentByTagName(J.startContainer, "pre", true);
            if (O) {
                if (!J.collapsed) {
                    J.deleteContents()
                }
                var K = "";
                if (E.ie && E.version > 8) {
                    C.each(UE.filterNode(UE.htmlparser(L), N.options.filterTxtRules).children,
                    function(R) {
                        if (R.type == "element") {
                            if (R.tagName == "br") {
                                K += "\n"
                            } else {
                                if (!u.$empty[R.tagName]) {
                                    C.each(R.children,
                                    function(S) {
                                        if (S.type == "element") {
                                            if (S.tagName == "br") {
                                                K += "\n"
                                            } else {
                                                if (!u.$empty[R.tagName]) {
                                                    K += S.innerText()
                                                }
                                            }
                                        } else {
                                            K += S.data
                                        }
                                    });
                                    if (!/\n$/.test(K)) {
                                        K += "\n"
                                    }
                                }
                            }
                        } else {
                            K += R.data + "\n"
                        }
                        if (!R.nextSibling() && /\n$/.test(K)) {
                            K = K.replace(/\n$/, "")
                        }
                    });
                    var M = N.document.createTextNode(C.html(K.replace(/&nbsp;/g, " ")));
                    J.insertNode(M).selectNode(M).select()
                } else {
                    var Q = N.document.createDocumentFragment();
                    C.each(UE.filterNode(UE.htmlparser(L), N.options.filterTxtRules).children,
                    function(R) {
                        if (R.type == "element") {
                            if (R.tagName == "br") {
                                Q.appendChild(N.document.createElement("br"))
                            } else {
                                if (!u.$empty[R.tagName]) {
                                    C.each(R.children,
                                    function(S) {
                                        if (S.type == "element") {
                                            if (S.tagName == "br") {
                                                Q.appendChild(N.document.createElement("br"))
                                            } else {
                                                if (!u.$empty[R.tagName]) {
                                                    Q.appendChild(N.document.createTextNode(C.html(S.innerText().replace(/&nbsp;/g, " "))))
                                                }
                                            }
                                        } else {
                                            Q.appendChild(N.document.createTextNode(C.html(S.data.replace(/&nbsp;/g, " "))))
                                        }
                                    });
                                    if (Q.lastChild.nodeName != "BR") {
                                        Q.appendChild(N.document.createElement("br"))
                                    }
                                }
                            }
                        } else {
                            Q.appendChild(N.document.createTextNode(C.html(R.data.replace(/&nbsp;/g, " "))))
                        }
                        if (!R.nextSibling() && Q.lastChild.nodeName == "BR") {
                            Q.removeChild(Q.lastChild)
                        }
                    });
                    J.insertNode(Q).select()
                }
                return true
            }
        });
        I.addListener("keydown",
        function(N, K) {
            var M = this,
            P = K.keyCode || K.which;
            if (P == 40) {
                var J = M.selection.getRange(),
                O,
                Q = J.startContainer;
                if (J.collapsed && (O = w.findParentByTagName(J.startContainer, "pre", true)) && !O.nextSibling) {
                    var L = O.lastChild;
                    while (L && L.nodeName == "BR") {
                        L = L.previousSibling
                    }
                    if (L === Q || J.startContainer === O && J.startOffset == O.childNodes.length) {
                        M.execCommand("insertparagraph");
                        w.preventDefault(K)
                    }
                }
            }
        })
    };
    var s = s || {}; s.editor = s.editor || {}; s.editor.ui = {}; (function() {
        var K = s.editor.browser,
        J = s.editor.dom.domUtils;
        var N = "$EDITORUI";
        var M = window[N] = {};
        var H = "ID" + N;
        var P = 0;
        var I = s.editor.ui.uiUtils = {
            uid: function(Q) {
                return (Q ? Q[H] || (Q[H] = ++P) : ++P)
            },
            hook: function(Q, S) {
                var R;
                if (Q && Q._callbacks) {
                    R = Q
                } else {
                    R = function() {
                        var W;
                        if (Q) {
                            W = Q.apply(this, arguments)
                        }
                        var V = R._callbacks;
                        var T = V.length;
                        while (T--) {
                            var U = V[T].apply(this, arguments);
                            if (W === undefined) {
                                W = U
                            }
                        }
                        return W
                    };
                    R._callbacks = []
                }
                R._callbacks.push(S);
                return R
            },
            createElementByHtml: function(Q) {
                var R = document.createElement("div");
                R.innerHTML = Q;
                R = R.firstChild;
                R.parentNode.removeChild(R);
                return R
            },
            getViewportElement: function() {
                return (K.ie && K.quirks) ? document.body: document.documentElement
            },
            getClientRect: function(Q) {
                var U;
                try {
                    U = Q.getBoundingClientRect()
                } catch(T) {
                    U = {
                        left: 0,
                        top: 0,
                        height: 0,
                        width: 0
                    }
                }
                var R = {
                    left: Math.round(U.left),
                    top: Math.round(U.top),
                    height: Math.round(U.bottom - U.top),
                    width: Math.round(U.right - U.left)
                };
                var S;
                while ((S = Q.ownerDocument) !== document && (Q = J.getWindow(S).frameElement)) {
                    U = Q.getBoundingClientRect();
                    R.left += U.left;
                    R.top += U.top
                }
                R.bottom = R.top + R.height;
                R.right = R.left + R.width;
                return R
            },
            getViewportRect: function() {
                var R = I.getViewportElement();
                var S = (window.innerWidth || R.clientWidth) | 0;
                var Q = (window.innerHeight || R.clientHeight) | 0;
                return {
                    left: 0,
                    top: 0,
                    height: Q,
                    width: S,
                    bottom: Q,
                    right: S
                }
            },
            setViewportOffset: function(Q, T) {
                var R;
                var S = I.getFixedLayer();
                if (Q.parentNode === S) {
                    Q.style.left = T.left + "px";
                    Q.style.top = T.top + "px"
                } else {
                    J.setViewportOffset(Q, T)
                }
            },
            getEventOffset: function(Q) {
                var R = Q.target || Q.srcElement;
                var S = I.getClientRect(R);
                var T = I.getViewportOffsetByEvent(Q);
                return {
                    left: T.left - S.left,
                    top: T.top - S.top
                }
            },
            getViewportOffsetByEvent: function(R) {
                var S = R.target || R.srcElement;
                var Q = J.getWindow(S).frameElement;
                var U = {
                    left: R.clientX,
                    top: R.clientY
                };
                if (Q && S.ownerDocument !== document) {
                    var T = I.getClientRect(Q);
                    U.left += T.left;
                    U.top += T.top
                }
                return U
            },
            setGlobal: function(R, Q) {
                M[R] = Q;
                return N + '["' + R + '"]'
            },
            unsetGlobal: function(Q) {
                delete M[Q]
            },
            copyAttributes: function(U, T) {
                var R = T.attributes;
                var Q = R.length;
                while (Q--) {
                    var S = R[Q];
                    if (S.nodeName != "style" && S.nodeName != "class" && (!K.ie || S.specified)) {
                        U.setAttribute(S.nodeName, S.nodeValue)
                    }
                }
                if (T.className) {
                    J.addClass(U, T.className)
                }
                if (T.style.cssText) {
                    U.style.cssText += ";" + T.style.cssText
                }
            },
            removeStyle: function(R, Q) {
                if (R.style.removeProperty) {
                    R.style.removeProperty(Q)
                } else {
                    if (R.style.removeAttribute) {
                        R.style.removeAttribute(Q)
                    } else {
                        throw ""
                    }
                }
            },
            contains: function(R, Q) {
                return R && Q && (R === Q ? false: (R.contains ? R.contains(Q) : R.compareDocumentPosition(Q) & 16))
            },
            startDrag: function(Y, U, W) {
                var W = W || document;
                var T = Y.clientX;
                var S = Y.clientY;
                function R(aa) {
                    var Z = aa.clientX - T;
                    var ab = aa.clientY - S;
                    U.ondragmove(Z, ab, aa);
                    if (aa.stopPropagation) {
                        aa.stopPropagation()
                    } else {
                        aa.cancelBubble = true
                    }
                }
                if (W.addEventListener) {
                    function X(Z) {
                        W.removeEventListener("mousemove", R, true);
                        W.removeEventListener("mouseup", X, true);
                        window.removeEventListener("mouseup", X, true);
                        U.ondragstop()
                    }
                    W.addEventListener("mousemove", R, true);
                    W.addEventListener("mouseup", X, true);
                    window.addEventListener("mouseup", X, true);
                    Y.preventDefault()
                } else {
                    var V = Y.srcElement;
                    V.setCapture();
                    function Q() {
                        V.releaseCapture();
                        V.detachEvent("onmousemove", R);
                        V.detachEvent("onmouseup", Q);
                        V.detachEvent("onlosecaptrue", Q);
                        U.ondragstop()
                    }
                    V.attachEvent("onmousemove", R);
                    V.attachEvent("onmouseup", Q);
                    V.attachEvent("onlosecaptrue", Q);
                    Y.returnValue = false
                }
                U.ondragstart()
            },
            getFixedLayer: function() {
                var Q = document.getElementById("edui_fixedlayer");
                if (Q == null) {
                    Q = document.createElement("div");
                    Q.id = "edui_fixedlayer";
                    document.body.appendChild(Q);
                    if (K.ie && K.version <= 8) {
                        Q.style.position = "absolute";
                        O();
                        setTimeout(L)
                    } else {
                        Q.style.position = "fixed"
                    }
                    Q.style.left = "0";
                    Q.style.top = "0";
                    Q.style.width = "0";
                    Q.style.height = "0"
                }
                return Q
            },
            makeUnselectable: function(R) {
                if (K.opera || (K.ie && K.version < 9)) {
                    R.unselectable = "on";
                    if (R.hasChildNodes()) {
                        for (var Q = 0; Q < R.childNodes.length; Q++) {
                            if (R.childNodes[Q].nodeType == 1) {
                                I.makeUnselectable(R.childNodes[Q])
                            }
                        }
                    }
                } else {
                    if (R.style.MozUserSelect !== undefined) {
                        R.style.MozUserSelect = "none"
                    } else {
                        if (R.style.WebkitUserSelect !== undefined) {
                            R.style.WebkitUserSelect = "none"
                        } else {
                            if (R.style.KhtmlUserSelect !== undefined) {
                                R.style.KhtmlUserSelect = "none"
                            }
                        }
                    }
                }
            }
        };
        function L() {
            var Q = document.getElementById("edui_fixedlayer");
            I.setViewportOffset(Q, {
                left: 0,
                top: 0
            })
        }
        function O(Q) {
            J.on(window, "scroll", L);
            J.on(window, "resize", s.editor.utils.defer(L, 0, true))
        }
    })(); (function() {
        var H = s.editor.utils,
        I = s.editor.ui.uiUtils,
        J = s.editor.EventBase,
        K = s.editor.ui.UIBase = function() {};
        K.prototype = {
            className: "",
            uiName: "",
            initOptions: function(M) {
                var N = this;
                for (var L in M) {
                    N[L] = M[L]
                }
                this.id = this.id || "edui" + I.uid()
            },
            initUIBase: function() {
                this._globalKey = H.unhtml(I.setGlobal(this.id, this))
            },
            render: function(T) {
                var P = this.renderHtml();
                var L = I.createElementByHtml(P);
                var R = w.getElementsByTagName(L, "*");
                var N = "edui-" + (this.theme || this.editor.options.theme);
                var Q = document.getElementById("edui_fixedlayer");
                for (var O = 0,
                M; M = R[O++];) {
                    w.addClass(M, N)
                }
                w.addClass(L, N);
                if (Q) {
                    Q.className = "";
                    w.addClass(Q, N)
                }
                var S = this.getDom();
                if (S != null) {
                    S.parentNode.replaceChild(L, S);
                    I.copyAttributes(L, S)
                } else {
                    if (typeof T == "string") {
                        T = document.getElementById(T)
                    }
                    T = T || I.getFixedLayer();
                    w.addClass(T, N);
                    T.appendChild(L)
                }
                this.postRender()
            },
            getDom: function(L) {
                if (!L) {
                    return document.getElementById(this.id)
                } else {
                    return document.getElementById(this.id + "_" + L)
                }
            },
            postRender: function() {
                this.fireEvent("postrender")
            },
            getHtmlTpl: function() {
                return ""
            },
            formatHtml: function(L) {
                var M = "edui-" + this.uiName;
                return (L.replace(/##/g, this.id).replace(/%%-/g, this.uiName ? M + "-": "").replace(/%%/g, (this.uiName ? M: "") + " " + this.className).replace(/\$\$/g, this._globalKey))
            },
            renderHtml: function() {
                return this.formatHtml(this.getHtmlTpl())
            },
            dispose: function() {
                var L = this.getDom();
                if (L) {
                    s.editor.dom.domUtils.remove(L)
                }
                I.unsetGlobal(this.id)
            }
        };
        H.inherits(K, J)
    })(); (function() {
        var H = s.editor.utils,
        I = s.editor.ui.UIBase,
        J = s.editor.ui.Separator = function(K) {
            this.initOptions(K);
            this.initSeparator()
        };
        J.prototype = {
            uiName: "separator",
            initSeparator: function() {
                this.initUIBase()
            },
            getHtmlTpl: function() {
                return '<div id="##" class="edui-box %%"></div>'
            }
        };
        H.inherits(J, I)
    })(); (function() {
        var I = s.editor.utils,
        H = s.editor.dom.domUtils,
        K = s.editor.ui.UIBase,
        J = s.editor.ui.uiUtils;
        var L = s.editor.ui.Mask = function(M) {
            this.initOptions(M);
            this.initUIBase()
        };
        L.prototype = {
            getHtmlTpl: function() {
                return '<div id="##" class="edui-mask %%" onmousedown="return $$._onMouseDown(event, this);"></div>'
            },
            postRender: function() {
                var M = this;
                H.on(window, "resize",
                function() {
                    setTimeout(function() {
                        if (!M.isHidden()) {
                            M._fill()
                        }
                    })
                })
            },
            show: function(M) {
                this._fill();
                this.getDom().style.display = "";
                this.getDom().style.zIndex = M
            },
            hide: function() {
                this.getDom().style.display = "none";
                this.getDom().style.zIndex = ""
            },
            isHidden: function() {
                return this.getDom().style.display == "none"
            },
            _onMouseDown: function() {
                return false
            },
            _fill: function() {
                var M = this.getDom();
                var N = J.getViewportRect();
                M.style.width = N.width + "px";
                M.style.height = N.height + "px"
            }
        };
        I.inherits(L, K)
    })(); (function() {
        var J = s.editor.utils,
        L = s.editor.ui.uiUtils,
        H = s.editor.dom.domUtils,
        O = s.editor.ui.UIBase,
        N = s.editor.ui.Popup = function(P) {
            this.initOptions(P);
            this.initPopup()
        };
        var I = [];
        function M(P, S) {
            var T = [];
            for (var R = 0; R < I.length; R++) {
                var Q = I[R];
                if (!Q.isHidden()) {
                    if (Q.queryAutoHide(S) !== false) {
                        if (P && /scroll/ig.test(P.type) && Q.className == "edui-wordpastepop") {
                            return
                        }
                        Q.hide()
                    }
                }
            }
        }
        N.postHide = M;
        var K = ["edui-anchor-topleft", "edui-anchor-topright", "edui-anchor-bottomleft", "edui-anchor-bottomright"];
        N.prototype = {
            SHADOW_RADIUS: 5,
            content: null,
            _hidden: false,
            autoRender: true,
            canSideLeft: true,
            canSideUp: true,
            initPopup: function() {
                this.initUIBase();
                I.push(this)
            },
            getHtmlTpl: function() {
                return '<div id="##" class="edui-popup %%"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="javascript:"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">' + this.getContentHtmlTpl() + "  </div> </div></div>"
            },
            getContentHtmlTpl: function() {
                if (this.content) {
                    if (typeof this.content == "string") {
                        return this.content
                    }
                    return this.content.renderHtml()
                } else {
                    return ""
                }
            },
            _UIBase_postRender: O.prototype.postRender,
            postRender: function() {
                if (this.content instanceof O) {
                    this.content.postRender()
                }
                this.fireEvent("postRenderAfter");
                this.hide(true);
                this._UIBase_postRender()
            },
            _doAutoRender: function() {
                if (!this.getDom() && this.autoRender) {
                    this.render()
                }
            },
            mesureSize: function() {
                var P = this.getDom("content");
                return L.getClientRect(P)
            },
            fitSize: function() {
                var P = this.getDom("body");
                P.style.width = "";
                P.style.height = "";
                var Q = this.mesureSize();
                P.style.width = Q.width + "px";
                P.style.height = Q.height + "px";
                return Q
            },
            showAnchor: function(Q, P) {
                this.showAnchorRect(L.getClientRect(Q), P)
            },
            showAnchorRect: function(W, T, U) {
                this._doAutoRender();
                var R = L.getViewportRect();
                this._show();
                var Q = this.fitSize();
                var X, S, P, V;
                if (T) {
                    X = this.canSideLeft && (W.right + Q.width > R.right && W.left > Q.width);
                    S = this.canSideUp && (W.top + Q.height > R.bottom && W.bottom > Q.height);
                    P = (X ? W.left - Q.width: W.right);
                    V = (S ? W.bottom - Q.height: W.top)
                } else {
                    X = this.canSideLeft && (W.right + Q.width > R.right && W.left > Q.width);
                    S = this.canSideUp && (W.top + Q.height > R.bottom && W.bottom > Q.height);
                    P = (X ? W.right - Q.width: W.left);
                    V = (S ? W.top - Q.height: W.bottom)
                }
                var Y = this.getDom();
                L.setViewportOffset(Y, {
                    left: P,
                    top: V
                });
                H.removeClasses(Y, K);
                Y.className += " " + K[(S ? 1 : 0) * 2 + (X ? 1 : 0)];
                if (this.editor) {
                    Y.style.zIndex = this.editor.container.style.zIndex * 1 + 10;
                    s.editor.ui.uiUtils.getFixedLayer().style.zIndex = Y.style.zIndex - 1
                }
            },
            showAt: function(S) {
                var R = S.left;
                var Q = S.top;
                var P = {
                    left: R,
                    top: Q,
                    right: R,
                    bottom: Q,
                    height: 0,
                    width: 0
                };
                this.showAnchorRect(P, false, true)
            },
            _show: function() {
                if (this._hidden) {
                    var P = this.getDom();
                    P.style.display = "";
                    this._hidden = false;
                    this.fireEvent("show")
                }
            },
            isHidden: function() {
                return this._hidden
            },
            show: function() {
                this._doAutoRender();
                this._show()
            },
            hide: function(P) {
                if (!this._hidden && this.getDom()) {
                    this.getDom().style.display = "none";
                    this._hidden = true;
                    if (!P) {
                        this.fireEvent("hide")
                    }
                }
            },
            queryAutoHide: function(P) {
                return ! P || !L.contains(this.getDom(), P)
            }
        };
        J.inherits(N, O);
        H.on(document, "mousedown",
        function(P) {
            var Q = P.target || P.srcElement;
            M(P, Q)
        });
        H.on(window, "scroll",
        function(P, Q) {
            M(P, Q)
        })
    })(); (function() {
        var J = s.editor.browser,
        H = s.editor.dom.domUtils,
        I = s.editor.ui.uiUtils;
        var K = 'onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"' + (J.ie ? (' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"') : (' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"'));
        s.editor.ui.Stateful = {
            alwalysHoverable: false,
            target: null,
            Stateful_init: function() {
                this._Stateful_dGetHtmlTpl = this.getHtmlTpl;
                this.getHtmlTpl = this.Stateful_getHtmlTpl
            },
            Stateful_getHtmlTpl: function() {
                var L = this._Stateful_dGetHtmlTpl();
                return L.replace(/stateful/g,
                function() {
                    return K
                })
            },
            Stateful_onMouseEnter: function(L, M) {
                this.target = M;
                if (!this.isDisabled() || this.alwalysHoverable) {
                    this.addState("hover");
                    this.fireEvent("over")
                }
            },
            Stateful_onMouseLeave: function(L, M) {
                if (!this.isDisabled() || this.alwalysHoverable) {
                    this.removeState("hover");
                    this.removeState("active");
                    this.fireEvent("out")
                }
            },
            Stateful_onMouseOver: function(M, N) {
                var L = M.relatedTarget;
                if (!I.contains(N, L) && N !== L) {
                    this.Stateful_onMouseEnter(M, N)
                }
            },
            Stateful_onMouseOut: function(M, N) {
                var L = M.relatedTarget;
                if (!I.contains(N, L) && N !== L) {
                    this.Stateful_onMouseLeave(M, N)
                }
            },
            Stateful_onMouseDown: function(L, M) {
                if (!this.isDisabled()) {
                    this.addState("active")
                }
            },
            Stateful_onMouseUp: function(L, M) {
                if (!this.isDisabled()) {
                    this.removeState("active")
                }
            },
            Stateful_postRender: function() {
                if (this.disabled && !this.hasState("disabled")) {
                    this.addState("disabled")
                }
            },
            hasState: function(L) {
                return H.hasClass(this.getStateDom(), "edui-state-" + L)
            },
            addState: function(L) {
                if (!this.hasState(L)) {
                    this.getStateDom().className += " edui-state-" + L
                }
            },
            removeState: function(L) {
                if (this.hasState(L)) {
                    H.removeClasses(this.getStateDom(), ["edui-state-" + L])
                }
            },
            getStateDom: function() {
                return this.getDom("state")
            },
            isChecked: function() {
                return this.hasState("checked")
            },
            setChecked: function(L) {
                if (!this.isDisabled() && L) {
                    this.addState("checked")
                } else {
                    this.removeState("checked")
                }
            },
            isDisabled: function() {
                return this.hasState("disabled")
            },
            setDisabled: function(L) {
                if (L) {
                    this.removeState("hover");
                    this.removeState("checked");
                    this.removeState("active");
                    this.addState("disabled")
                } else {
                    this.removeState("disabled")
                }
            }
        }
    })(); (function() {
        var I = s.editor.utils,
        K = s.editor.ui.UIBase,
        J = s.editor.ui.Stateful,
        H = s.editor.ui.Button = function(L) {
            this.initOptions(L);
            this.initButton()
        };
        H.prototype = {
            uiName: "button",
            label: "",
            title: "",
            showIcon: true,
            showText: true,
            initButton: function() {
                this.initUIBase();
                this.Stateful_init()
            },
            getHtmlTpl: function() {
                return '<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" ' + (this.title ? 'title="' + this.title + '"': "") + ' class="%%-body" onmousedown="return false;" onclick="return $$._onClick();">' + (this.showIcon ? '<div class="edui-box edui-icon"></div>': "") + (this.showText ? '<div class="edui-box edui-label">' + this.label + "</div>": "") + "</div></div></div></div>"
            },
            postRender: function() {
                this.Stateful_postRender();
                this.setDisabled(this.disabled)
            },
            _onClick: function() {
                if (!this.isDisabled()) {
                    this.fireEvent("click")
                }
            }
        };
        I.inherits(H, K);
        I.extend(H.prototype, J)
    })(); (function() {
        var O = s.editor.utils,
        K = s.editor.dom.domUtils,
        I = s.editor.ui.uiUtils,
        J = s.editor.ui.UIBase,
        P = s.editor.ui.Popup,
        H = s.editor.ui.Stateful,
        Q = s.editor.ui.CellAlignPicker,
        L = s.editor.ui.Menu = function(R) {
            this.initOptions(R);
            this.initMenu()
        };
        var M = {
            renderHtml: function() {
                return '<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'
            },
            postRender: function() {},
            queryAutoHide: function() {
                return true
            }
        };
        L.prototype = {
            items: null,
            uiName: "menu",
            initMenu: function() {
                this.items = this.items || [];
                this.initPopup();
                this.initItems()
            },
            initItems: function() {
                for (var R = 0; R < this.items.length; R++) {
                    var S = this.items[R];
                    if (S == "-") {
                        this.items[R] = this.getSeparator()
                    } else {
                        if (! (S instanceof N)) {
                            S.editor = this.editor;
                            S.theme = this.editor.options.theme;
                            this.items[R] = this.createItem(S)
                        }
                    }
                }
            },
            getSeparator: function() {
                return M
            },
            createItem: function(R) {
                R.menu = this;
                return new N(R)
            },
            _Popup_getContentHtmlTpl: P.prototype.getContentHtmlTpl,
            getContentHtmlTpl: function() {
                if (this.items.length == 0) {
                    return this._Popup_getContentHtmlTpl()
                }
                var T = [];
                for (var R = 0; R < this.items.length; R++) {
                    var S = this.items[R];
                    T[R] = S.renderHtml()
                }
                return ('<div class="%%-body">' + T.join("") + "</div>")
            },
            _Popup_postRender: P.prototype.postRender,
            postRender: function() {
                var T = this;
                for (var R = 0; R < this.items.length; R++) {
                    var S = this.items[R];
                    S.ownerMenu = this;
                    S.postRender()
                }
                K.on(this.getDom(), "mouseover",
                function(V) {
                    V = V || event;
                    var U = V.relatedTarget || V.fromElement;
                    var W = T.getDom();
                    if (!I.contains(W, U) && W !== U) {
                        T.fireEvent("over")
                    }
                });
                this._Popup_postRender()
            },
            queryAutoHide: function(S) {
                if (S) {
                    if (I.contains(this.getDom(), S)) {
                        return false
                    }
                    for (var R = 0; R < this.items.length; R++) {
                        var T = this.items[R];
                        if (T.queryAutoHide(S) === false) {
                            return false
                        }
                    }
                }
            },
            clearItems: function() {
                for (var R = 0; R < this.items.length; R++) {
                    var S = this.items[R];
                    clearTimeout(S._showingTimer);
                    clearTimeout(S._closingTimer);
                    if (S.subMenu) {
                        S.subMenu.destroy()
                    }
                }
                this.items = []
            },
            destroy: function() {
                if (this.getDom()) {
                    K.remove(this.getDom())
                }
                this.clearItems()
            },
            dispose: function() {
                this.destroy()
            }
        };
        O.inherits(L, P);
        var N = s.editor.ui.MenuItem = function(R) {
            this.initOptions(R);
            this.initUIBase();
            this.Stateful_init();
            if (this.subMenu && !(this.subMenu instanceof L)) {
                if (R.className && R.className.indexOf("aligntd") != -1) {
                    var S = this;
                    this.subMenu.selected = this.editor.queryCommandValue("cellalignment");
                    this.subMenu = new P({
                        content: new Q(this.subMenu),
                        parentMenu: S,
                        editor: S.editor,
                        destroy: function() {
                            if (this.getDom()) {
                                K.remove(this.getDom())
                            }
                        }
                    });
                    this.subMenu.addListener("postRenderAfter",
                    function() {
                        K.on(this.getDom(), "mouseover",
                        function() {
                            S.addState("opened")
                        })
                    })
                } else {
                    this.subMenu = new L(this.subMenu)
                }
            }
        };
        N.prototype = {
            label: "",
            subMenu: null,
            ownerMenu: null,
            uiName: "menuitem",
            alwalysHoverable: true,
            getHtmlTpl: function() {
                return '<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">' + this.renderLabelHtml() + "</div></div>"
            },
            postRender: function() {
                var R = this;
                this.addListener("over",
                function() {
                    R.ownerMenu.fireEvent("submenuover", R);
                    if (R.subMenu) {
                        R.delayShowSubMenu()
                    }
                });
                if (this.subMenu) {
                    this.getDom().className += " edui-hassubmenu";
                    this.subMenu.render();
                    this.addListener("out",
                    function() {
                        R.delayHideSubMenu()
                    });
                    this.subMenu.addListener("over",
                    function() {
                        clearTimeout(R._closingTimer);
                        R._closingTimer = null;
                        R.addState("opened")
                    });
                    this.ownerMenu.addListener("hide",
                    function() {
                        R.hideSubMenu()
                    });
                    this.ownerMenu.addListener("submenuover",
                    function(T, S) {
                        if (S !== R) {
                            R.delayHideSubMenu()
                        }
                    });
                    this.subMenu._bakQueryAutoHide = this.subMenu.queryAutoHide;
                    this.subMenu.queryAutoHide = function(S) {
                        if (S && I.contains(R.getDom(), S)) {
                            return false
                        }
                        return this._bakQueryAutoHide(S)
                    }
                }
                this.getDom().style.tabIndex = "-1";
                I.makeUnselectable(this.getDom());
                this.Stateful_postRender()
            },
            delayShowSubMenu: function() {
                var R = this;
                if (!R.isDisabled()) {
                    R.addState("opened");
                    clearTimeout(R._showingTimer);
                    clearTimeout(R._closingTimer);
                    R._closingTimer = null;
                    R._showingTimer = setTimeout(function() {
                        R.showSubMenu()
                    },
                    250)
                }
            },
            delayHideSubMenu: function() {
                var R = this;
                if (!R.isDisabled()) {
                    R.removeState("opened");
                    clearTimeout(R._showingTimer);
                    if (!R._closingTimer) {
                        R._closingTimer = setTimeout(function() {
                            if (!R.hasState("opened")) {
                                R.hideSubMenu()
                            }
                            R._closingTimer = null
                        },
                        400)
                    }
                }
            },
            renderLabelHtml: function() {
                return '<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">' + (this.label || "") + "</div>"
            },
            getStateDom: function() {
                return this.getDom()
            },
            queryAutoHide: function(R) {
                if (this.subMenu && this.hasState("opened")) {
                    return this.subMenu.queryAutoHide(R)
                }
            },
            _onClick: function(R, S) {
                if (this.hasState("disabled")) {
                    return
                }
                if (this.fireEvent("click", R, S) !== false) {
                    if (this.subMenu) {
                        this.showSubMenu()
                    } else {
                        P.postHide(R)
                    }
                }
            },
            showSubMenu: function() {
                var R = I.getClientRect(this.getDom());
                R.right -= 5;
                R.left += 2;
                R.width -= 7;
                R.top -= 4;
                R.bottom += 4;
                R.height += 8;
                this.subMenu.showAnchorRect(R, true, true)
            },
            hideSubMenu: function() {
                this.subMenu.hide()
            }
        };
        O.inherits(N, J);
        O.extend(N.prototype, H, true)
    })(); (function() {
        var J = s.editor.utils,
        L = s.editor.ui.uiUtils,
        H = s.editor.dom.domUtils,
        M = s.editor.ui.UIBase,
        K = s.editor.ui.Stateful,
        I = s.editor.ui.SplitButton = function(N) {
            this.initOptions(N);
            this.initSplitButton()
        };
        I.prototype = {
            popup: null,
            uiName: "splitbutton",
            title: "",
            initSplitButton: function() {
                this.initUIBase();
                this.Stateful_init();
                var O = this;
                if (this.popup != null) {
                    var N = this.popup;
                    this.popup = null;
                    this.setPopup(N)
                }
            },
            _UIBase_postRender: M.prototype.postRender,
            postRender: function() {
                this.Stateful_postRender();
                this._UIBase_postRender()
            },
            setPopup: function(N) {
                if (this.popup === N) {
                    return
                }
                if (this.popup != null) {
                    this.popup.dispose()
                }
                N.addListener("show", J.bind(this._onPopupShow, this));
                N.addListener("hide", J.bind(this._onPopupHide, this));
                N.addListener("postrender", J.bind(function() {
                    N.getDom("body").appendChild(L.createElementByHtml('<div id="' + this.popup.id + '_bordereraser" class="edui-bordereraser edui-background" style="width:' + (L.getClientRect(this.getDom()).width - 2) + 'px"></div>'));
                    N.getDom().className += " " + this.className
                },
                this));
                this.popup = N
            },
            _onPopupShow: function() {
                this.addState("opened")
            },
            _onPopupHide: function() {
                this.removeState("opened")
            },
            getHtmlTpl: function() {
                return '<div id="##" class="edui-box %%"><div ' + (this.title ? 'title="' + this.title + '"': "") + ' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'
            },
            showPopup: function() {
                var N = L.getClientRect(this.getDom());
                N.top -= this.popup.SHADOW_RADIUS;
                N.height += this.popup.SHADOW_RADIUS;
                this.popup.showAnchorRect(N)
            },
            _onArrowClick: function(O, N) {
                if (!this.isDisabled()) {
                    this.showPopup()
                }
            },
            _onButtonClick: function() {
                if (!this.isDisabled()) {
                    this.fireEvent("buttonclick")
                }
            }
        };
        J.inherits(I, M);
        J.extend(I.prototype, K, true)
    })(); (function() {
        var I = s.editor.utils,
        K = s.editor.ui.uiUtils,
        L = s.editor.ui.Menu,
        H = s.editor.ui.SplitButton,
        J = s.editor.ui.Combox = function(M) {
            this.initOptions(M);
            this.initCombox()
        };
        J.prototype = {
            uiName: "combox",
            initCombox: function() {
                var O = this;
                this.items = this.items || [];
                for (var M = 0; M < this.items.length; M++) {
                    var N = this.items[M];
                    N.uiName = "listitem";
                    N.index = M;
                    N.onclick = function() {
                        O.selectByIndex(this.index)
                    }
                }
                this.popup = new L({
                    items: this.items,
                    uiName: "list",
                    editor: this.editor
                });
                this.initSplitButton()
            },
            _SplitButton_postRender: H.prototype.postRender,
            postRender: function() {
                this._SplitButton_postRender();
                this.setLabel(this.label || "");
                this.setValue(this.initValue || "")
            },
            showPopup: function() {
                var M = K.getClientRect(this.getDom());
                M.top += 1;
                M.bottom -= 1;
                M.height -= 2;
                this.popup.showAnchorRect(M)
            },
            getValue: function() {
                return this.value
            },
            setValue: function(N) {
                var M = this.indexByValue(N);
                if (M != -1) {
                    this.selectedIndex = M;
                    this.setLabel(this.items[M].label);
                    this.value = this.items[M].value
                } else {
                    this.selectedIndex = -1;
                    this.setLabel(this.getLabelForUnknowValue(N));
                    this.value = N
                }
            },
            setLabel: function(M) {
                this.getDom("button_body").innerHTML = M;
                this.label = M
            },
            getLabelForUnknowValue: function(M) {
                return M
            },
            indexByValue: function(N) {
                for (var M = 0; M < this.items.length; M++) {
                    if (N == this.items[M].value) {
                        return M
                    }
                }
                return - 1
            },
            getItem: function(M) {
                return this.items[M]
            },
            selectByIndex: function(M) {
                if (M < this.items.length && this.fireEvent("select", M) !== false) {
                    this.selectedIndex = M;
                    this.value = this.items[M].value;
                    this.setLabel(this.items[M].label)
                }
            }
        };
        I.inherits(J, H)
    })(); (function() {
        var H = s.editor.utils,
        I = s.editor.ui.uiUtils,
        K = s.editor.ui.UIBase,
        J = s.editor.ui.Toolbar = function(L) {
            this.initOptions(L);
            this.initToolbar()
        };
        J.prototype = {
            items: null,
            initToolbar: function() {
                this.items = this.items || [];
                this.initUIBase()
            },
            add: function(L) {
                this.items.push(L)
            },
            getHtmlTpl: function() {
                var M = [];
                for (var L = 0; L < this.items.length; L++) {
                    M[L] = this.items[L].renderHtml()
                }
                return '<div id="##" class="hancong edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">' + M.join("") + "</div>"
            },
            postRender: function() {
                var M = this.getDom();
                for (var L = 0; L < this.items.length; L++) {
                    this.items[L].postRender()
                }
                I.makeUnselectable(M)
            },
            _onMouseDown: function() {
                return false
            }
        };
        H.inherits(J, K)
    })(); (function() {
        var Q = s.editor.utils,
        H = s.editor.ui.Stateful,
        K = s.editor.ui.UIBase,
        N = s.editor.ui.Button,
        R = s.editor.ui.Popup;
        var L = s.editor.ui.AttachPicker = function(U) {
            this.initOptions(U);
            this.initAttechPicker()
        };
        var O, S, J, M, T = false;
        var P = {
            _errorBoxKey: "iknowDialogErrorBox",
            _coverBtnKey: "iknowDialogSbumitCover",
            _cache: null,
            _coverConfirm: null,
            _warningDialog: null,
            select: function(U) {
                this.updateSubmitState(U);
                if (!U.path) {
                    this._cache = null;
                    return
                }
                if (this.checkData(U)) {
                    this._cache = U
                } else {
                    this._cache = null
                }
            },
            insert: function() {
                I.hide();
                var U = this._cache;
                if (!U || !U.path) {
                    this.showWarning("\u672a\u9009\u62e9\u6587\u4ef6!");
                    return false
                } else {
                    if (this.isImageFile(U.path)) {
                        this.showWarning("\u63d2\u5165\u56fe\u7247\u8bf7\u4f7f\u7528\u56fe\u7247\u529f\u80fd!");
                        return false
                    } else {
                        if (this.hasAttachment()) {
                            this.showConfirm()
                        } else {
                            this.updateFile();
                            this._cache = null
                        }
                    }
                }
            },
            dialogopen: function() {
                var X = g(".BDWidget_dialog_footer .dlg-sbtn"),
                U = null,
                W = null;
                if (X.length) {
                    U = X.position();
                    X.addClass("iknow_ue_disable");
                    W = document.createElement("div");
                    W.id = this._coverBtnKey;
                    W.style.cssText = ["position: absolute", "top: 0", "left: 0", "width: 270px", "height: 56px", "z-index: 999", "background: white", "filter: alpha(opacity=0)", "opacity: 0"].join("; ");
                    U = g(".BDWidget_dialog_footer");
                    U && U.append(W);
                    var V = document.createElement("div");
                    V.id = this._errorBoxKey;
                    V.style.cssText = ["font: 14px/20px Arial", "text-align: right", "color: red", "position: absolute", "bottom: 45px", "right: 0", "padding-right: 20px;"].join(";");
                    V.innerHTML = "&nbsp;";
                    U = U[0];
                    if (!U) {
                        return null
                    }
                    U.parentNode.insertBefore(V, U)
                }
            },
            updateSubmitState: function(U) {
                if (!U.path || this.isImageFile(U.path)) {
                    this.disableSubmit()
                } else {
                    this.enableSubmit()
                }
            },
            disableSubmit: function() {
                var U = g("#" + this._coverBtnKey);
                if (U.length) {
                    U.show();
                    g(".BDWidget_dialog_footer .dlg-sbtn").addClass("iknow_ue_disable")
                }
            },
            enableSubmit: function() {
                var U = g("#" + this._coverBtnKey);
                if (U.length) {
                    U.hide();
                    g(".BDWidget_dialog_footer .dlg-sbtn").removeClass("iknow_ue_disable")
                }
            },
            updateFile: function() {
                if (!this._cache) {
                    return false
                }
                this._cache.wealth = 0;
                O.setUploadFile({
                    error: false,
                    fileInfo: this._cache
                },
                true);
                return true
            },
            cancel: function() {
                I.hide();
                this._cache = null
            },
            checkData: function(V) {
                var U = true;
                if (this.isImageFile(V.path)) {
                    this.showError("\u63d2\u5165\u56fe\u7247\u8bf7\u4f7f\u7528\u56fe\u7247\u529f\u80fd\uff01");
                    U = false
                } else {
                    this.clearError()
                }
                return U
            },
            hasAttachment: function() {
                return O.swfupload && O.swfupload.customSettings.successCount > 0
            },
            showConfirm: function() {
                var U = this;
                if (!this._coverConfirm) {
                    this._coverConfirm = new k({
                        type: "confirm",
                        width: 400,
                        height: 150,
                        titleText: "\u77e5\u9053\u63d0\u793a",
                        content: '<div class="f-14"><img class="grid" src="http://img.baidu.com/img/iknow/feedback/icon-question.png"><p>\u60a8\u53ea\u80fd\u4e0a\u4f20\u4e00\u4e2a\u9644\u4ef6\uff0c\u4e0a\u4e00\u9644\u4ef6\u5c06\u88ab\u8986\u76d6\uff0c\u786e\u5b9a\u5417\uff1f</p><p class="f-12 f-gray pl-20">\uff08\u5982\u679c\u60f3\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6\uff0c\u8bf7\u6253\u5305\uff09</p></div>',
                        onaccept: function() {
                            U.updateFile();
                            l.fire("dialog.close")
                        },
                        oncancel: function() {
                            l.fire("dialog.close")
                        }
                    })
                } else {
                    this._coverConfirm.show()
                }
            },
            showWarning: function(V) {
                var U = this;
                if (!this._warningDialog) {
                    this._warningDialog = new k({
                        width: 400,
                        height: 150,
                        type: "alert",
                        titleText: "\u77e5\u9053\u63d0\u793a",
                        content: '<div style="color: red; text-align: center;">' + V + "</div>",
                        onaccept: function() {
                            l.fire("dialog.close")
                        }
                    })
                } else {
                    this._warningDialog.setContnet(V).show()
                }
            },
            isImageFile: function(U) {
                return /\.((jpg)|(jpeg)|(gif)|(bmp)|(png)|(jpe)|(cur)|(tif)|(tiff)|(ico))$/i.test(U)
            },
            showError: function(V) {
                var U = this.getErrorBox();
                U && (U.innerHTML = V)
            },
            clearError: function() {
                this.showError("&nbsp;")
            },
            getErrorBox: function() {
                return g("#iknowDialogErrorBox")[0]
            }
        };
        var I = {
            wrap: null,
            attachWarningDialog: null,
            init: function(V) {
                var U = this;
                if (this.wrap) {
                    return this
                }
                var X = document.getElementById("BDWidget_dialog_body"),
                W = {
                    width: g(document).width(),
                    height: g(document).height()
                };
                zIndex = X ? g(X).css("zIndex") - 1 : 5000;
                this.wrap = document.createElement("div");
                this.wrap.style.cssText = ["width:" + W.width + "px", "height:" + W.height + "px", "position: absolute", "top: 0", "left: 0", "background: #2d2d2d", "z-index:" + zIndex, "filter: alpha(opacity=20)", "opacity:0.2", "display: none"].join("; ");
                document.body.insertBefore(this.wrap, document.body.firstChild);
                g(V).on("click",
                function() {
                    if (!UE.AttachInited) {
                        if (!U.attachWarningDialog) {
                            U.attachWarningDialog = new k({
                                width: 400,
                                height: 150,
                                type: "alert",
                                titleText: "\u77e5\u9053\u63d0\u793a",
                                content: '<div style="color: red; text-align: center;">\u7f51\u76d8\u672a\u51c6\u5907\u5c31\u7eea</div>',
                                onaccept: function() {
                                    l.fire("dialog.close")
                                }
                            })
                        }
                        U.attachWarningDialog.show();
                        return false
                    }
                    I.show()
                })
            },
            show: function() {
                this.wrap.style.display = "block";
                return this
            },
            hide: function() {
                this.wrap.style.display = "none";
                return this
            }
        };
        L.prototype = {
            initAttechPicker: function() {
                this.initUIBase();
                this.initButtons();
                this.Stateful_init()
            },
            initButtons: function() {
                var V = this;
                O = this.editor;
                O.ui.uploadfile = S = (function(Z) {
                    var W = "uploadfile",
                    ad = Z.options.buttonConfig.attachment["list"][W],
                    aa = +new Date(),
                    ae = "swfuPlaceholder" + aa,
                    Y = "swfuFlash" + aa,
                    X = "swfuProgress" + aa,
                    ab = "swfuWealth" + aa;
                    var ac = new N({
                        className: "edui-for-" + W,
                        label: ad,
                        showText: true,
                        getHtmlTpl: function() {
                            return '<div id="##">' + this.label + '</div><div class="ue_flash" id="' + Y + '"><div id="' + ae + '"></div></div>'
                        },
                        onmouseover: function() {
                            this.addState("hover")
                        },
                        onmouseout: function() {
                            this.removeState("hover")
                        },
                        getStateDom: function() {
                            return g("#" + Y + "")[0].parentNode
                        }
                    });
                    ac.addListener("postrender",
                    function() {
                        var ah = "",
                        ak = Z.options.wealthList,
                        al = document.createElement("div");
                        for (var af = 0; af < ak.length; af++) {
                            var ag = ak[af];
                            ah += '<option value="' + ag.key + '">' + ag.value + "</option>"
                        }
                        al.id = X;
                        al.innerHTML = '<div class="progressWrapper" style="display:none;"><div class="fileIcon icon_file_default"></div><div class="progressName textClip"></div><div class="progressSize"></div><div class="progressRename"><input class="progressRenameValue" type="text"><a class="btn btn-22-green progressRenameBtn" rel="nofollow"><em><b>\u786e\u5b9a</b></em></a></div><div class="progressMessage"></div><div class="progressBarWrapper"><div class="progressBar"></div><span class="progressBarText"></span></div><div class="progressWealthWrapper"><span class="progressWealthText">\u5b9a\u4ef7:</span><select name="wealth" class="progressWealth" id="' + ab + '">' + ah + '</select></div><a class="progressCancel" href="#">\u53d6\u6d88</a><div class="progressFileOperator"><a href="#" class="rename">\u91cd\u547d\u540d</a><a href="#" class="remove">\u5220\u9664</a></div></div>';
                        Z.ui.getDom().insertBefore(al, Z.ui.getDom("iframeholder"));
                        Z._uploadFile = {
                            fileInfo: null,
                            backFileInfo: null,
                            score: 0,
                            status: "ready",
                            errorCode: null
                        };
                        Z.swfupload = new SWFUpload({
                            flash_url: Z.options.swfUploadFlashUrl,
                            upload_url: Z.options.swfUploadUrl,
                            file_post_name: Z.options.swfUploadPostName,
                            file_types: "*.*",
                            file_types_description: "All Files",
                            file_queue_limit: 0,
                            file_size_limit: "4 GB",
                            custom_settings: {
                                progressTarget: X,
                                swfUploadUrl: Z.options.swfUploadUrl,
                                swfUploadDir: Z.options.swfUploadDir,
                                isLogin: Z.options.isLogin,
                                isInsertFromWangPan: false,
                                isEditorFile: false,
                                isUploading: false,
                                successCount: 0,
                                currentFile: null,
                                getUploadFile: function(am) {
                                    if (am == undefined) {
                                        am = "fileInfo"
                                    }
                                    return Z._uploadFile[am] || null
                                },
                                setUploadFile: function(ao, an, am) {
                                    if (Z._uploadFile.hasOwnProperty(ao)) {
                                        if (am && Z._uploadFile[ao]) {
                                            Z._uploadFile[ao][am] = an
                                        } else {
                                            Z._uploadFile[ao] = an
                                        }
                                        return true
                                    } else {
                                        return false
                                    }
                                },
                                setBindUploadStatus: function(am, an) {
                                    Z._uploadFile.status = am;
                                    if (am == "error") {
                                        Z._uploadFile.errorCode = an
                                    } else {
                                        Z._uploadFile.errorCode = null
                                    }
                                },
                                setEditorStatusBar: function(am) {
                                    if (g(".f-red", Z.container).length) {
                                        g(".edui-editor-wordcount", Z.container).eq(0).html(am)
                                    }
                                },
                                hideAllPopup: function() {
                                    R.postHide()
                                }
                            },
                            button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE,
                            button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
                            button_cursor: SWFUpload.CURSOR.HAND,
                            button_placeholder_id: ae,
                            button_width: 70,
                            button_height: 24,
                            minimum_flash_version: "9.0.28",
                            swfupload_pre_load_handler: swfUploadPreLoad,
                            swfupload_loaded_handler: swfUploadLoaded,
                            swfupload_load_failed_handler: swfUploadLoadFailed,
                            file_dialog_start_handler: swfUploadFileDialogStart,
                            file_dialog_complete_handler: swfUploadFileDialogComplete,
                            file_queued_handler: swfUploadFileQueued,
                            file_queue_error_handler: swfUploadFileQueueError,
                            queue_complete_handler: swfUploadQueueComplete,
                            upload_start_handler: swfUploadSendStart,
                            upload_progress_handler: swfUploadSendProgress,
                            upload_success_handler: swfUploadSendSuccess,
                            upload_error_handler: swfUploadSendError,
                            upload_complete_handler: swfUploadSendComplete
                        });
                        Z.setUploadFile = function(an, am) {
                            editorSetUploadFile(an, am, Z);
                            document.getElementById(ab).selectedIndex = (an.fileInfo && an.fileInfo["wealth"]) ? an.fileInfo["wealth"] : 0
                        };
                        Z.getUploadFile = function() {
                            var am = {};
                            am.status = Z._uploadFile.status;
                            am.errorCode = Z._uploadFile.errorCode;
                            am.fileInfo = Z._uploadFile.fileInfo || {};
                            am.fileInfo["wealth"] = document.getElementById(ab).value;
                            return am
                        };
                        Z.uploadAction = function(an, am) {
                            editorSubmitUploadFile(an, Z, am)
                        };
                        var ai = function(am) {
                            return document.getElementById(am)
                        };
                        var aj = ai(Y);
                        if (!/^[\s]*<object/i.test(aj.innerHTML)) {
                            aj.title = "\u60a8\u7684Flash\u63d2\u4ef6\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u66f4\u65b0\u540e\u518d\u5c1d\u8bd5\uff01"
                        }
                    });
                    return ac
                })(this.editor);
                O.ui.wangpan = J = (function(W) {
                    var Y = "wangpan",
                    Z = W.options.buttonConfig.attachment["list"][Y];
                    var X = new N({
                        className: "edui-for-" + Y + " " + Y,
                        label: Z,
                        getHtmlTpl: function() {
                            return '<div id="iknowWPBtn" onclick="$$._onClickWangpan(event);">' + this.label + "</div>"
                        },
                        onmouseover: function() {
                            this.addState("hover")
                        },
                        onmouseout: function() {
                            this.removeState("hover")
                        },
                        getStateDom: function() {
                            return g("#iknowWPBtn")[0].parentNode
                        },
                        showText: true
                    });
                    X._onWangPanDialogOk = function() {};
                    X.editor = W;
                    V.addListener("postrender",
                    function() {
                        I.init(document.getElementById("iknowWPBtn"));
                        U()
                    });
                    W.addListener("attachresourceready", U);
                    if (g.browser && g.browser.ie < 7) {
                        window.wangpanEditorForIE = W
                    }
                    return X
                })(this.editor);
                function U() {
                    var W = null;
                    if (UE.AttachInited) {
                        return
                    }
                    if (!UE.AttachResourceReady || !window.BDWidget) {
                        return
                    }
                    UE.AttachInited = true;
                    W = document.getElementById("iknowWPBtn");
                    BDWidget.init(O.options.WP_KEY,
                    function() {
                        this.insertFrom({
                            ele: W,
                            onSuccess: function() {
                                P.insert()
                            },
                            onSelect: function(X) {
                                P.select(X)
                            },
                            onCancel: function() {
                                P.cancel()
                            },
                            onLoad: function() {
                                P.dialogopen()
                            }
                        })
                    })
                }
            },
            getHtmlTpl: function() {
                return '<div id="##" class="edui-attachpicker %%"><div class="edui-attachpicker-top"></div><div class="edui-attachpicker-body"><div class="edui-attachpicker-item edui-attachpicker-uploadfile" stateful _title="\u4e0a\u4f20\u6587\u4ef6\u5230\u7f51\u76d8">' + S.getHtmlTpl() + '</div><div class="edui-attachpicker-item edui-attachpicker-wangpan" stateful _title="\u4ece\u7f51\u76d8\u63d2\u5165\u6587\u4ef6">' + J.getHtmlTpl() + "</div></div></div>"
            },
            getStateDom: function() {
                return this.target
            },
            postRender: function() {
                S.fireEvent("postrender");
                this.fireEvent("postrender")
            },
            _onClick: function(U) {
                R.postHide(U);
                if (!this.isDisabled()) {
                    this.fireEvent("click")
                }
            },
            _onMouseOver: function(U) {
                if (!this.isDisabled()) {
                    this.fireEvent("mouseover")
                }
            },
            _onMouseOut: function(U) {
                if (!this.isDisabled()) {
                    this.fireEvent("mouseout")
                }
            },
            _onClickWangpan: function(U) {
                R.postHide(U)
            },
            _UIBase_render: K.prototype.render
        };
        Q.inherits(L, K);
        Q.extend(L.prototype, H, true)
    })(); UE.Editor.prototype.hasWordOverflow = function() {
        return this.getContentLength(true) > this.options.maximumWords
    }; UE.Editor.prototype.getIconName = function(I) {
        var K = {
            icon_file_image: "jpg,jpeg,gif,bmp,png,jpe,cur,svg,svgz,tif,tiff,ico",
            icon_file_visio: "vsd,vsdx",
            icon_file_pdf: "pdf",
            icon_file_word: "doc,docx,ods,ots,odt,rtf,dot,dotx,odm",
            icon_file_excel: "xls,xlsx,xlt,xltx,csv",
            icon_file_text: "txt,html,htm,xhtml,xml,js,css",
            icon_file_music: "wma,wav,mp3,aac,ra,ram,mp2,ogg,aif,mpega,amr,mid,midi",
            icon_file_video: "wmv,rmvb,mpeg4,mpeg2,flv,avi,3gp,mpga,qt,rm,wmz,wmd,wvx,wmx,wm,swf,mpg,mp4,mkv,mpeg,mov",
            icon_file_powerpoint: "ppt,pptx,pps,pot,ppsx,potx",
            icon_file_ipa: "ipa",
            icon_file_exe: "exe,msi",
            icon_file_zip: "zip,rar,7z,tar,gz",
            icon_file_apk: "apk",
            icon_file_default: "default",
            icon_file_torrent: "torrent"
        },
        H = {};
        for (i in K) {
            var J = K[i].split(",");
            for (j in J) {
                H.hasOwnProperty(J[j]);
                if (H[J[j]] == undefined) {
                    H[J[j]] = i
                }
            }
        }
        return H[I.toLowerCase()] ? H[I.toLowerCase()] : H["default"]
    }; s.editor.ui.Toolbar.prototype.getHtmlTpl = function() {
        var I = [];
        for (var H = 0; H < this.items.length; H++) {
            I[H] = this.items[H].renderHtml()
        }
        return '<div id="##" class="edui-toolbar %%" onselectstart="return false;" >' + I.join("") + "</div>"
    }; s.editor.ui.Button.prototype.getHtmlTpl = function() {
        return '<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" ' + (this.title ? 'title="' + this.title + '"': "") + ' class="%%-body" onmousedown="return false;" onclick="return $$._onClick(event, this);" onmouseover="return $$._onMouseOver();" onmouseout="return $$._onMouseOut();">' + (this.showIcon ? '<div class="edui-box edui-icon"></div>': "") + (this.showText ? '<div class="edui-box edui-label">' + this.label + "</div>": "") + "</div></div></div></div>"
    }; s.editor.ui.Button.prototype._onMouseOver = function() {
        if (!this.isDisabled()) {
            this.fireEvent("mouseover")
        }
    }; s.editor.ui.Button.prototype._onMouseOut = function() {
        if (!this.isDisabled()) {
            this.fireEvent("mouseout")
        }
    };
    var q = UE.Editor.prototype._setup; UE.Editor.prototype._setup = function() {
        q.apply(this, arguments);
        this.fireEvent("selectionchange")
    }; UE.Editor.prototype.initAttach = function() {
        if (this.attachment) {
            document.getElementById("edui_fixedlayer").style.display = "none";
            this.attachment.fireEvent("mouseover");
            this.attachment.fireEvent("mouseout");
            window.setTimeout(function() {
                document.getElementById("edui_fixedlayer").style.display = ""
            },
            500)
        }
    };
    var d = s.editor.ui.Combox.prototype.showPopup; s.editor.ui.Combox.prototype.showPopup = function() {
        d.apply(this, arguments);
        if (this.popup && (!s.editor.browser.ie || s.editor.browser.version > 6)) {
            this.popup.getDom().style.position = "fixed"
        }
    }; s.editor.ui.Popup.prototype.getHtmlTpl = function() {
        return '<div id="##" class="edui-popup %%"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1; display: none; left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="javascript:"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">' + this.getContentHtmlTpl() + "  </div> </div></div>"
    }; UE.plugins.autoheight = function() {
        var K = this;
        K.autoHeightEnabled = K.options.autoHeightEnabled !== false;
        if (!K.autoHeightEnabled) {
            return
        }
        var H, L = 0,
        I = K.options,
        M, O;
        function N() {
            var P = this;
            clearTimeout(O);
            if (J) {
                return
            }
            if (!P.queryCommandState || P.queryCommandState && P.queryCommandState("source") != 1) {
                O = setTimeout(function() {
                    var Q = P.body.lastChild;
                    M = Math.max(w.getXY(Q).y + Q.offsetHeight + 25, Math.max(I.minFrameHeight, I.initialFrameHeight));
                    if (M != L) {
                        if (M < P.options.initialMaxFrameHeight) {
                            P.setHeight(M);
                            L = M;
                            P.body.style.overflowY = "hidden";
                            P.autoHeightEnabled = true
                        } else {
                            P.setHeight(P.options.initialMaxFrameHeight);
                            L = M;
                            P.body.style.overflowY = H || "";
                            P.autoHeightEnabled = false
                        }
                    }
                },
                50)
            }
        }
        var J;
        K.addListener("fullscreenchanged",
        function(Q, P) {
            J = P
        });
        K.addListener("destroy",
        function() {
            K.removeListener("contentchange afterinserthtml keyup mouseup", N)
        });
        K.enableAutoHeight = function() {
            var P = this;
            if (!P.autoHeightEnabled) {
                return
            }
            var Q = P.document;
            P.autoHeightEnabled = true;
            H = Q.body.style.overflowY;
            Q.body.style.overflowY = "hidden";
            P.addListener("contentchange afterinserthtml keyup mouseup", N);
            setTimeout(function() {
                N.call(P)
            },
            E.gecko ? 100 : 0);
            P.fireEvent("autoheightchanged", P.autoHeightEnabled)
        };
        K.disableAutoHeight = function() {
            K.body.style.overflowY = H || "";
            K.removeListener("contentchange", N);
            K.removeListener("keyup", N);
            K.removeListener("mouseup", N);
            K.autoHeightEnabled = false;
            K.fireEvent("autoheightchanged", K.autoHeightEnabled)
        };
        K.addListener("ready",
        function() {
            K.enableAutoHeight();
            var P;
            w.on(E.ie ? K.body: K.document, E.webkit ? "dragover": "drop",
            function() {
                clearTimeout(P);
                P = setTimeout(function() {
                    N.call(K)
                },
                100)
            })
        })
    }; UE.plugins.image = function() {
        var H = true,
        I = this.options;
        UE.commands.insertimage = {
            execCommand: function(L, J) {
                var K = this;
                if (!J.src) {
                    return
                }
                var M;
                M = "<p><img " + (J.id ? ' id="' + J.id + '"': "") + ' src="' + J.src + '" ' + (J.data_ue_src ? ' data_ue_src="' + J.data_ue_src + '" ': "") + (J.width ? 'width="' + J.width + '" ': "") + (J.height ? ' height="' + J.height + '" ': "") + (J.alt ? ' alt="' + J.alt + '"': "") + "/></p>";
                K.execCommand("inserthtml", M);
                if (H) {
                    K.setHeight(I.initialFrameHeight + I.heightIncrement);
                    H = false
                }
            },
            queryCommandState: function() {
                var J = this.document.getElementsByTagName("img");
                return J.length > I.maxImagesCount - 1 ? -2 : 0
            }
        }
    }; UE.commands.insertmap = {
        queryCommandState: function() {
            return this.document.getElementsByTagName("iframe").length == 0 ? 0 : -2
        }
    }; UE.commands.deletemap = {
        execCommand: function() {
            var H = this.document.getElementsByTagName("iframe")[0];
            H && H.parentNode.removeChild(H)
        }
    }; (function() {
        var N = s.editor.dom.domUtils,
        Q = s.editor.ui;
        Q.buttons = {};
        var O = function(T) {
            return document.getElementById(T)
        };
        Q.insertimage = function(V) {
            var T = V.options.buttonConfig.insertimage,
            Z = T.title,
            ab = T.hoverTitle,
            X = T.overflowMsg,
            U, aa = "ue_con_" + +new Date();
            var Y = new Q.Button({
                className: "edui-for-insertimage",
                title: ab || "",
                label: Z || "",
                alwalysHoverable: true,
                postRender: function() {
                    this.Stateful_postRender();
                    this.setDisabled(this.disabled);
                    this.fireEvent("renderReady")
                },
                getHtmlTpl: function() {
                    return '<div id="##" class="edui-box %%" ' + (this.title ? 'title="' + this.title + '"': "") + '><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" class="%%-body" >' + (this.showIcon ? '<div class="edui-box edui-icon"></div>': "") + (this.showText ? '<div class="edui-box edui-label">' + this.label + "</div>": "") + '</div></div></div><div id="' + aa + '" class="ue_flash"></div></div>'
                },
                onmouseover: function(ac) {
                    UE.ui.Popup.postHide(ac)
                },
                showText: true
            });
            Y.addListener("renderReady",
            function() {
                N.on(Y.getDom(), "mouseover",
                function(aq) { ! Y.isDisabled() && Y.addState("hover")
                });
                N.on(Y.getDom(), "mouseout",
                function(aq) {
                    Y.removeState("hover")
                });
                var ai = "ue_flash_" + +new Date();
                s.swf.create({
                    id: ai,
                    url: V.options.flashUrl,
                    width: V.options.imgFlashWidth,
                    height: V.options.imgFlashHeight,
                    errorMessage: "\u60a8\u7684Flash\u63d2\u4ef6\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u66f4\u65b0\u540e\u518d\u5c1d\u8bd5\uff01",
                    wmode: "transparent",
                    ver: "9.0.0",
                    vars: {
                        width: V.options.imgFlashWidth,
                        height: V.options.imgFlashHeight,
                        fileExtension: V.options.acceptImageType,
                        fileSize: V.options.imageMaxSize
                    }
                },
                aa);
                var ac = O(aa);
                if (!ac.children[0]) {
                    if (E.firefox) {
                        ac.innerText = ""
                    } else {
                        ac.textContent = ""
                    }
                    ac.title = "\u60a8\u7684Flash\u63d2\u4ef6\u7248\u672c\u8fc7\u4f4e\uff0c\u8bf7\u66f4\u65b0\u540e\u518d\u5c1d\u8bd5\uff01"
                }
                var ao = setInterval(am, 50);
                U = s.swf.getMovie(ai);
                var an = "ue_success" + +new Date,
                af = "ue_error" + +new Date,
                ak = "ue_select" + +new Date,
                ah = "ue_checkupload" + +new Date,
                ap = "ue_logout" + +new Date;
                function am() {
                    if (U && U.flashInit && U.flashInit()) {
                        clearInterval(ao);
                        if (!V.options.isLogin) {
                            U.setHandCursor(false)
                        } else {
                            U.setHandCursor(true);
                            U.setJSFuncName([an, af, ak, ap, ah])
                        }
                    }
                }
                if (!V.options.isLogin) {
                    var ad = Y.getDom(),
                    aj = O(ad.id + "_body").children[1];
                    aj.style.color = "#999";
                    ad.setAttribute("title", ab);
                    var ag = O(ad.id + "_body").children[0];
                    N.removeClasses(ag, ["edui-icon"]);
                    N.addClass(ag, "edui_disableIcon");
                    N.addClass(aj, "edui-label-disabled")
                }
                window[ah] = function() {
                    V.fireEvent("flashClicked");
                    return V.options.isLogin
                };
                window[ak] = function(at) {
                    V.fireEvent("imageBeforeUploadEvent");
                    if (at.errorNo) {
                        V.fireEvent("imageSizeError");
                        return
                    }
                    var ar = +new Date,
                    au = V.options.waitImageUrl;
                    V.execCommand("insertimage", {
                        id: "ue_waitflag_" + ar,
                        src: au,
                        data_ue_src: au
                    });
                    V.fireEvent("contentchange");
                    var aq = V.options.customObj;
                    aq.position = ar;
                    aq.editorIndex = aa;
                    U.upload(V.options.imageUrl, V.options.imageFieldName, aq)
                };
                window[an] = function(aq) {
                    al(aq.index, aq.url ? V.options.imagePath + aq.url: null);
                    V.fireEvent("uploadSuccess", aq)
                };
                window[ap] = function() {
                    V.fireEvent("isLogout")
                };
                window[af] = function(aq) {
                    al(aq.index);
                    V.fireEvent("networkError", aq)
                };
                function ae(ar) {
                    if (s.editor.browser.chrome) {
                        var aq = document.createElement("input");
                        aq.type = "text";
                        aq.style.height = "0";
                        aq.style.width = "0";
                        ar.container.parentNode.appendChild(aq);
                        setTimeout(function() {
                            aq.focus();
                            ar.focus();
                            aq.parentNode.removeChild(aq)
                        },
                        1)
                    }
                }
                function al(ar, aq) {
                    var at = V.document.getElementById("ue_waitflag_" + ar);
                    at.hasLoaded = false;
                    if (aq && at) {
                        at.setAttribute("data_ue_src", aq);
                        at.removeAttribute("id");
                        at.removeAttribute("_src");
                        at.onload = function() {
                            if (this.hasLoaded) {
                                return
                            }
                            this.hasLoaded = true;
                            var av = V.document.createElement("span");
                            av.style.cssText = "display:block;width:0;margin:0;padding:0;border:0;clear:both;";
                            av.innerHTML = ".";
                            var au = av.cloneNode(true);
                            V.selection.getRange().insertNode(au);
                            N.scrollToView(au, N.getWindow(au), 0);
                            au && au.parentNode.removeChild(au);
                            V.fireEvent("contentchange")
                        };
                        at.src = aq
                    } else {
                        at && at.parentNode.removeChild(at)
                    }
                    ae(V);
                    V.fireEvent("contentchange")
                }
            });
            function W(ad, ae, af, ac) {
                if (!ad) {
                    return
                }
                var ag = setInterval(function() {
                    if (ac == 0) {
                        clearInterval(ag)
                    }
                    if (!ad[ae]) {
                        ac--
                    } else {
                        ad[ae]();
                        clearInterval(ag)
                    }
                },
                af)
            }
            V.addListener("selectionchange",
            function() {
                var ae = V.queryCommandState("insertimage"),
                af = Y.getDom(),
                ac = O(af.id + "_body").children[1];
                if (!V.options.isLogin) {
                    Y.setDisabled(true);
                    ac.style.color = "#999";
                    af.setAttribute("title", ab);
                    var ad = O(af.id + "_body").children[0];
                    N.removeClasses(ad, ["edui-icon"]);
                    N.addClass(ad, "edui_disableIcon");
                    return
                }
                if (ae < 0) {
                    Y.setDisabled(true);
                    Y.setChecked(false);
                    W(U, "disabledUpload", 200, 100);
                    if (ae === -2) {
                        Y.getDom().setAttribute("title", X);
                        N.addClass(ac, "edui-label-overflow")
                    }
                } else {
                    Y.setDisabled(false);
                    Y.setChecked(ae);
                    W(U, "enabledUpload", 200, 100);
                    Y.getDom().setAttribute("title", ab);
                    N.removeClasses(ac, ["edui-label-overflow"])
                }
            });
            return Y
        };
        Q.insertmap = function(V) {
            var U = V.options.buttonConfig.insertmap,
            Y = U.title,
            W = U.unTitle,
            T = U.hoverTitle;
            var X = new Q.Button({
                className: "edui-for-insertmap insertmap",
                title: T,
                label: Y,
                alwalysHoverable: true,
                onmouseover: function(Z) {
                    UE.ui.Popup.postHide(Z)
                },
                onclick: function() {
                    if (V.options.isLogin) {
                        V.fireEvent("showmap")
                    }
                },
                showText: true
            });
            X.addListener("renderReady",
            function() {
                if (!V.options.isLogin) {
                    var ab = X.getDom(),
                    Z = O(ab.id + "_body").children[1],
                    aa = O(ab.id + "_body").children[0];
                    Z.style.color = "#999";
                    ab.setAttribute("title", T);
                    N.removeClasses(aa, ["edui-icon"]);
                    N.addClass(aa, "edui_disableIcon")
                }
            });
            V.addListener("selectionchange",
            function() {
                var ab = V.queryCommandState("insertmap"),
                ac = X.getDom(),
                Z = O(ac.id + "_body").children[1];
                if (!V.options.isLogin) {
                    X.setDisabled(true);
                    X.setChecked(false);
                    X.getDom().setAttribute("title", T);
                    var aa = O(ac.id + "_body").children[0];
                    N.removeClasses(aa, ["edui-icon"]);
                    N.addClass(aa, "edui_disableIcon");
                    return
                }
                if (ab == -1) {
                    X.setDisabled(true);
                    X.setChecked(false)
                } else {
                    if (ab == -2) {
                        X.setDisabled(false);
                        X.setChecked(ab);
                        X.onclick = function() {
                            V.execCommand("deletemap")
                        };
                        N.removeClasses(ac, "insertmap");
                        N.addClass(ac, "deletemap");
                        ac.setAttribute("title", W);
                        Z.innerHTML = W
                    } else {
                        X.setDisabled(false);
                        X.setChecked(ab);
                        X.onclick = function() {
                            V.fireEvent("showMap")
                        };
                        N.removeClasses(ac, "deletemap");
                        N.addClass(ac, "insertmap");
                        ac.setAttribute("title", T);
                        Z.innerHTML = Y
                    }
                }
            });
            return X
        };
        Q.attachment = function(X) {
            var W = "attachment",
            U = X.options.buttonConfig[W],
            Z = U.title,
            ab = U.hoverTitle,
            aa,
            T;
            var Y = new Q.Button({
                className: "edui-for-" + W,
                title: ab,
                label: Z || "",
                alwalysHoverable: true,
                onmouseover: function(ac) {
                    T && clearTimeout(T);
                    if (!aa) {
                        V()
                    }
                    if (X.options.isLogin && X._uploadFile.status != "uploading" && X._uploadFile.status != "finish") {
                        UE.ui.Popup.postHide(ac);
                        aa.showAnchor(this.getDom())
                    }
                },
                onmouseout: function(ac) {
                    T = setTimeout(function() {
                        UE.ui.Popup.postHide(ac)
                    },
                    500)
                },
                onclick: function(ac) {
                    if (!aa) {
                        V()
                    }
                    if (X.options.isLogin && X._uploadFile.status != "uploading" && X._uploadFile.status != "finish") {
                        UE.ui.Popup.postHide(ac);
                        aa.showAnchor(this.getDom())
                    }
                },
                theme: X.options.theme,
                showText: true
            });
            function V() {
                aa = new Q.Popup({
                    content: (function() {
                        var ac = new Q.AttachPicker({
                            editor: X,
                            Stateful_onMouseOut: function(ad, af) {
                                Y.fireEvent("mouseout", arguments[0]);
                                var ae = g(af);
                                if (ae.hasClass("edui-attachpicker-uploadfile")) {
                                    X.ui.uploadfile.fireEvent("mouseout")
                                } else {
                                    if (ae.hasClass("edui-attachpicker-wangpan")) {
                                        X.ui.wangpan.fireEvent("mouseout")
                                    }
                                }
                            },
                            Stateful_onMouseOver: function(ad, af) {
                                Y.fireEvent("mouseover", arguments[0]);
                                var ae = g(af);
                                if (ae.hasClass("edui-attachpicker-uploadfile")) {
                                    X.ui.uploadfile.fireEvent("mouseover")
                                } else {
                                    if (ae.hasClass("edui-attachpicker-wangpan")) {
                                        X.ui.wangpan.fireEvent("mouseover")
                                    }
                                }
                            },
                            Stateful_onMouseEnter: function(ad, ae) {
                                this.Stateful_onMouseOver(ad, ae)
                            },
                            Stateful_onMouseLeave: function(ad, ae) {
                                this.Stateful_onMouseOut(ad, ae)
                            },
                            Stateful_onMouseDown: function() {},
                            Stateful_onMouseUp: function() {}
                        });
                        return ac
                    })(),
                    editor: X,
                    className: "edui-attachPop",
                    hide: function(ac) {
                        if (!this._hidden && this.getDom()) {
                            this.getDom().style.left = "-10000px";
                            this._hidden = true;
                            if (!ac) {
                                this.fireEvent("hide")
                            }
                        }
                    }
                });
                aa.render()
            }
            Y.addListener("renderReady",
            function() {
                V();
                if (!X.options.isLogin) {
                    var ae = Y.getDom(),
                    ac = O(ae.id + "_body").children[1],
                    ad = O(ae.id + "_body").children[0];
                    ac.style.color = "#999";
                    ae.setAttribute("title", ab);
                    N.removeClasses(ad, ["edui-icon"]);
                    N.addClass(ad, "edui_disableIcon")
                }
            });
            X.addListener("selectionchange",
            function(ad, ac, af) {
                var ae = X.queryCommandState(W);
                if (!X.options.isLogin || ae == -1) {
                    Y.setDisabled(true);
                    Y.setChecked(false)
                } else {
                    if (!af) {
                        Y.setDisabled(false);
                        Y.setChecked(ae)
                    }
                }
            });
            X.attachment = Y;
            return Y
        };
        var M = ["bold", "italic"];
        var P;
        function I(T) {
            if (!P) {
                return
            }
            if (!g(P.getTipContainer()).contains(T.target)) {
                P.hide();
                L();
                g(document).unbind("click", I)
            }
        }
        function J(V, U) {
            var T = U - ("" + Math.abs(V)).length + 1;
            return Array(T > 0 ? T: 0).join(0) + V
        }
        function H(X) {
            var T = Math.floor(X / (60 * 60 * 24)),
            U = J(Math.floor(X / (60 * 60)) % 24, 2),
            W = J(Math.floor(X / (60)) % 60, 2),
            V = "";
            if (T) {
                V += T + "\u5929"
            }
            if (U != "00") {
                V += U + "\u5c0f\u65f6"
            }
            if (W != "00") {
                V += W + "\u5206\u949f"
            }
            return V
        }
        function L() {
            var U = new Date(),
            T = U.getFullYear() + "-" + (U.getMonth() + 1) + "-" + (U.getDate() + 1) + " 00:00:00",
            V = g.date.parse(T).getTime() - U.getTime() + 1000 * 60 * 60 * 8;
            g.cookie.set("IK_PRIVILEGE", "1", {
                path: "/",
                expires: V
            })
        }
        g(M).each(function(T, U) {
            var V = U;
            Q[V] = function(X) {
                var W = X.options.buttonConfig[V],
                aa = W.title;
                var Z = X.options.isLogin && (V != "bold" || X.options.hasBoldPrivilege) && (V != "italic" || X.options.hasRedPrivilege);
                var Y = new Q.Button({
                    className: "edui-for-" + V + " " + V,
                    label: aa || "",
                    alwalysHoverable: true,
                    onmouseover: function(ac) {
                        UE.ui.Popup.postHide(ac);
                        g(document).unbind("click", I);
                        if (P) {
                            P.hide()
                        }
                        var ab = "",
                        ae = "",
                        ag = "",
                        ah = "",
                        ad = {
                            width: 200,
                            closebox: false,
                            offset: [0, 0],
                            closebox: true,
                            direction: "up",
                            skin: "privilege-tip privilege-tip-" + V,
                            autoDispose: true
                        };
                        g.object.each(F.context("privilege"),
                        function(aj, ai) {
                            if (V == "bold") {
                                privilegeType = "replyBold"
                            } else {
                                if (V == "italic") {
                                    privilegeType = "replyRed"
                                }
                            }
                            if (ai == privilegeType) {
                                if (V == "bold") {
                                    ab = "/shop/view?id=831";
                                    ae = "\u52a0\u7c97"
                                }
                                if (V == "italic") {
                                    ab = "/shop/view?id=834";
                                    ae = "\u98d8\u7ea2"
                                }
                                if (Z) {
                                    if (aj.is_card == "1") {
                                        if ((aj.days == "1" && aj.remain_time <= 60 * 60 * 10) || (aj.days != "1" && aj.remain_time <= 60 * 60 * 24)) {
                                            ah = "\u5269\u4f59\u6709\u6548\u671f\u8fd8\u6709" + H(aj.remain_time) + '<br/><a href="' + ab + '" target="_blank">\u7acb\u5373\u53bb\u5546\u57ce\u7eed\u671f\u5427</a>'
                                        }
                                    }
                                } else {
                                    if (aj.number > 0) {
                                        ah = "\u60a8\u5df2\u8d2d\u4e70" + ae + '\u7279\u6743\u5361<br/><a href="/uhome/myitem#footer" target="_blank">\u7acb\u5373\u4f7f\u7528\u5427</a>';
                                        ad.width = 150
                                    } else {
                                        ah = '<a href="' + ab + '" target="_blank">\u7acb\u5373\u5230\u5546\u57ce\u5151\u6362</a>';
                                        ad.width = 120
                                    }
                                }
                            } else {
                                return
                            }
                        });
                        ad.content = ['<p class="f-12">', ah, "</p>"].join("");
                        if (ah != "") {
                            P = new A(ad);
                            var af = g("#" + Y.id).get(0);
                            P.show(af)
                        }
                        g(document).one("click", I)
                    },
                    onclick: function() {
                        X.fireEvent("beforeexeccmd", V);
                        if (Z) {
                            X.execCommand(V)
                        } else {
                            return
                        }
                    },
                    showText: true
                });
                Y.addListener("renderReady",
                function() {
                    if (!Z) {
                        var ad = Y.getDom(),
                        ab = O(ad.id + "_body").children[1];
                        ab.style.color = "#999";
                        var ac = O(ad.id + "_body").children[0];
                        N.removeClasses(ac, ["edui-icon"]);
                        N.addClass(ac, "edui_disableIcon")
                    }
                });
                X.addListener("ready",
                function(ab) {
                    if (!g.cookie.get("IK_PRIVILEGE")) {
                        setTimeout(function() {
                            Y.fireEvent("mouseover")
                        },
                        200)
                    }
                });
                X.addListener("selectionchange",
                function(ae, ac, ag) {
                    var af = X.queryCommandState(V),
                    ah = Y.getDom(),
                    ab = O(ah.id + "_body").children[1];
                    if (!Z) {
                        ab.style.color = "#999";
                        var ad = O(ah.id + "_body").children[0];
                        N.removeClasses(ad, ["edui-icon"]);
                        N.addClass(ad, "edui_disableIcon");
                        return
                    }
                    if (af == -1) {
                        Y.setDisabled(true);
                        Y.setChecked(false)
                    } else {
                        if (!ag) {
                            Y.setDisabled(false);
                            Y.setChecked(af)
                        }
                    }
                });
                return Y
            }
        });
        var S = ["insertorderedlist", "insertunorderedlist", "autotypeset"];
        for (var K = 0,
        R; R = S[K++];) { (function(T) {
            Q[T] = function(W) {
                var V = W.options.buttonConfig[T],
                Z = V.title,
                U = V.hoverTitle;
                var Y = W.options.isLogin && (T != "bold" || W.options.hasBoldPrivilege) && (T != "italic" || W.options.hasRedPrivilege);
                var X = new Q.Button({
                    className: "edui-for-" + T + " " + T,
                    title: U,
                    label: Z || "",
                    alwalysHoverable: true,
                    onmouseover: function(aa) {
                        UE.ui.Popup.postHide(aa)
                    },
                    onclick: function() {
                        W.fireEvent("beforeexeccmd", T);
                        if (Y) {
                            W.execCommand(T)
                        } else {
                            if (T == "bold" || T == "italic") {
                                var aa = "\u5440\uff0c\u4f60\u8fd8\u4e0d\u80fd\u4f7f\u7528\u56de\u7b54\u52a0\u7c97\u7279\u6743&gt;.&lt;<br>\u5feb\u767b\u5f55\u4e86\u770b\u770b\u7b26\u5408\u7279\u6743\u6761\u4ef6\u4e0d\uff01";
                                if (W.options.isLogin) {
                                    aa = ["\u5440\uff0c\u4f60\u8fd8\u4e0d\u80fd\u4f7f\u7528\u56de\u7b54\u52a0\u7c97\u7279\u6743&gt;.&lt;", '\u8fd8\u5dee<span style="color:#ed7e3b;font-weight:bold;">' + ((T == "bold" ? 5 : 10) - (F.context("user").highQualityNum || 0)) + '</span>\u4e2a<a target="_blank" href="http://zhidao.baidu.com/s/quality/">\u4f18\u8d28\u7b54\u6848</a>\u5c31\u53ef\u4ee5\u4e86\u54df\uff01', "\u4e3a\u4e86\u5f00\u542f\u52a0\u7c97\u7279\u6743\u800c\u52aa\u529b\u5427\uff0c\u52a0\u6cb9\u3002"].join("<br>")
                                }
                                if (W.options.isLogin && F.context("user").gradeIndex < 5) {
                                    aa = ["\u5440\uff0c\u4f60\u8fd8\u4e0d\u80fd\u4f7f\u7528\u56de\u7b54\u52a0\u7c97\u7279\u6743&gt;.&lt;", '\u5feb\u5347\u52305\u7ea7\uff0c\u518d\u6709<span style="color:#ed7e3b;font-weight:bold;">' + ((T == "bold" ? 5 : 10) - (F.context("user").highQualityNum || 0)) + '</span>\u4e2a<a target="_blank" href="http://zhidao.baidu.com/s/quality/">\u4f18\u8d28\u7b54\u6848</a>\u5c31\u53ef\u4ee5\u4e86\u54df\uff01', "\u4e3a\u4e86\u5f00\u542f\u52a0\u7c97\u7279\u6743\u800c\u52aa\u529b\u5427\uff0c\u52a0\u6cb9\u3002"].join("<br>")
                                }
                                if (T == "italic") {
                                    aa = aa.replace(/\u52a0\u7c97/g, "\u52a0\u7ea2")
                                }
                                k.alert(aa, {
                                    height: 180
                                })
                            }
                        }
                    },
                    showText: true
                });
                X.addListener("renderReady",
                function() {
                    if (!Y) {
                        var ac = X.getDom(),
                        aa = O(ac.id + "_body").children[1];
                        aa.style.color = "#999";
                        ac.setAttribute("title", U);
                        var ab = O(ac.id + "_body").children[0];
                        N.removeClasses(ab, ["edui-icon"]);
                        N.addClass(ab, "edui_disableIcon")
                    }
                });
                W.addListener("selectionchange",
                function(ad, ab, af) {
                    var ae = W.queryCommandState(T),
                    ag = X.getDom(),
                    aa = O(ag.id + "_body").children[1];
                    if (!Y) {
                        X.setDisabled(true);
                        aa.style.color = "#999";
                        ag.setAttribute("title", U);
                        var ac = O(ag.id + "_body").children[0];
                        N.removeClasses(ac, ["edui-icon"]);
                        N.addClass(ac, "edui_disableIcon");
                        return
                    }
                    if (ae == -1) {
                        X.setDisabled(true);
                        X.setChecked(false)
                    } else {
                        if (!af) {
                            X.setDisabled(false);
                            X.setChecked(ae)
                        }
                    }
                });
                return X
            }
        })(R)
        }
        Q.insertcode = function(W) {
            var U = W.options.buttonConfig.insertcode,
            Z = "\u4ee3\u7801\u8bed\u8a00",
            T = U.hoverTitle,
            Y = W.options.insertcode || [];
            var V = [];
            C.each(Y,
            function(aa, ab) {
                V.push({
                    label: aa,
                    value: ab,
                    theme: W.options.theme,
                    renderLabelHtml: function() {
                        return '<div class="edui-label %%-label" >' + (this.label || "") + "</div>"
                    }
                })
            });
            var X = new Q.Combox({
                editor: W,
                items: V,
                onselect: function(ab, aa) {
                    W.execCommand("insertcode", this.items[aa].value)
                },
                onbuttonclick: function() {
                    this.showPopup()
                },
                title: T,
                initValue: Z,
                className: "edui-for-insertcode",
                indexByValue: function(ac) {
                    if (ac) {
                        for (var ab = 0,
                        aa; aa = this.items[ab]; ab++) {
                            if (aa.value.indexOf(ac) != -1) {
                                return ab
                            }
                        }
                    }
                    return - 1
                }
            });
            W.addListener("selectionchange",
            function(ab, aa, ad) {
                X.getDom().setAttribute("title", T);
                if (!W.options.isLogin) {
                    X.setDisabled(true)
                } else {
                    X.setDisabled(false);
                    var ac = W.queryCommandValue("insertcode");
                    if (!ac) {
                        X.setValue(Z);
                        return
                    }
                    ac && (ac = ac.replace(/['"]/g, "").split(",")[0]);
                    X.setValue(ac)
                }
            });
            return X
        };
        Q.toggleeditor = function(U) {
            var T = U.options.buttonConfig.toggleeditor,
            X = T.title,
            V = T.unTitle;
            var W = new Q.Button({
                className: "hideeditor",
                label: X
            });
            W.addListener("renderReady",
            function() {
                var Z = W.getDom();
                var Y = s.editor.dom.domUtils;
                Y.on(Z, "click",
                function() {
                    if (Y.hasClass(Z, "hideeditor")) {
                        Y.removeClasses(W, ["hideeditor"]);
                        Y.addClass(W, "showeditor");
                        U.fireEvent("hideEditor", U.ui.getDom())
                    } else {
                        if (Y.hasClass(Z, "showeditor")) {
                            Y.removeClasses(iconBtn, ["showeditor"]);
                            Y.addClass(iconBtn, "hideeditor");
                            U.fireEvent("showEditor", U.ui.getDom())
                        }
                    }
                })
            });
            return W
        };
        Q.insertplace = function(V) {
            var U = V.options.buttonConfig.insertplace,
            Y = U.title,
            W = U.unTitle,
            T = U.hoverTitle;
            var X = new Q.Button({
                className: "edui-for-insertplace insertplace",
                title: T,
                label: Y,
                _onClick: function(Z, aa) {
                    if (V.options.isLoginForPlace) {
                        V.fireEvent("showPlaceDialog", "add")
                    }
                    Z.stopPropagation ? Z.stopPropagation() : (Z.cancelBubble = true)
                },
                showText: true
            });
            X.addListener("renderReady",
            function() {
                var aa = X.getDom();
                var Z = O(aa.id + "_body").children[1];
                if (!V.options.isLoginForPlace) {
                    Z.style.color = "#999";
                    X.onclick = function() {
                        V.fireEvent("isLogout")
                    }
                } else {
                    X.onclick = function() {
                        V.fireEvent("showPlaceDialog", "add")
                    };
                    N.removeClasses(X, ["editplace"]);
                    N.addClass(X, "insertplace");
                    Z.innerHTML = Y
                }
                aa.onclick = function(ab) {
                    ab = ab || window.event;
                    ab.stopPropagation ? ab.stopPropagation() : ab.cancelBubble = true
                }
            });
            V.addListener("addPlace",
            function() {
                var Z = O(X.getDom().id + "_body").children[1];
                if (!V.options.isLoginForPlace) {
                    Z.style.color = "#999";
                    V.fireEvent("isLogout");
                    return
                }
                X.onclick = function() {
                    V.fireEvent("showPlaceDialog", "edit")
                };
                N.addClass(X, "editplace");
                Z.innerHTML = W
            });
            V.addListener("deletePlace",
            function() {
                var Z = O(X.getDom().id + "_body").children[1];
                if (!V.options.isLoginForPlace) {
                    Z.style.color = "#999";
                    V.fireEvent("isLogout");
                    return
                }
                X.onclick = function() {
                    V.fireEvent("showPlaceDialog", "add")
                };
                N.removeClasses(X, ["editplace"]);
                N.addClass(X, "insertplace");
                Z.innerHTML = Y
            });
            return X
        }
    })(); (function() {
        var I = s.editor.utils,
        K = s.editor.ui.uiUtils,
        M = s.editor.ui.UIBase,
        H = s.editor.dom.domUtils;
        var L = [];
        function J(O) {
            this.initOptions(O);
            this.initEditorUI()
        }
        J.prototype = {
            uiName: "editor",
            initEditorUI: function() {
                this.editor.ui = this;
                this._dialogs = {};
                this.initUIBase();
                this._initToolbars();
                var Q = this.editor,
                R = this;
                Q.addListener("ready",
                function() {
                    Q.getDialog = function(W) {
                        return Q.ui._dialogs[W + "Dialog"]
                    };
                    H.on(Q.window, "scroll",
                    function(W) {
                        s.editor.ui.Popup.postHide(W)
                    });
                    Q.ui._actualFrameWidth = Q.options.initialFrameWidth;
                    if (Q.options.elementPathEnabled) {
                        Q.ui.getDom("elementpath").innerHTML = '<div class="edui-editor-breadcrumb">' + Q.getLang("elementPathTip") + ":</div>"
                    }
                    if (Q.options.wordCount) {
                        function V() {
                            S(Q, R);
                            H.un(Q.document, "click", arguments.callee)
                        }
                        H.on(Q.document, "click", V);
                        Q.ui.getDom("wordcount").innerHTML = Q.getLang("wordCountTip")
                    }
                    Q.ui._scale();
                    if (Q.options.scaleEnabled) {
                        if (Q.autoHeightEnabled) {
                            Q.disableAutoHeight()
                        }
                        R.enableScale()
                    } else {
                        R.disableScale()
                    }
                    if (!Q.options.elementPathEnabled && !Q.options.wordCount && !Q.options.scaleEnabled) {
                        Q.ui.getDom("elementpath").style.display = "none";
                        Q.ui.getDom("wordcount").style.display = "none";
                        Q.ui.getDom("scale").style.display = "none"
                    }
                    if (!Q.selection.isFocus()) {
                        return
                    }
                    Q.fireEvent("selectionchange", false, true)
                });
                Q.addListener("mousedown",
                function(W, V) {
                    var X = V.target || V.srcElement;
                    s.editor.ui.Popup.postHide(V, X)
                });
                Q.addListener("delcells",
                function() {
                    if (UE.ui.edittip) {
                        new UE.ui.edittip(Q)
                    }
                    Q.getDialog("edittip").open()
                });
                var P, T = false,
                U;
                Q.addListener("afterpaste",
                function() {
                    if (Q.queryCommandState("pasteplain")) {
                        return
                    }
                    P = new s.editor.ui.Popup({
                        content: new s.editor.ui.PastePicker({
                            editor: Q
                        }),
                        editor: Q,
                        className: "edui-wordpastepop"
                    });
                    P.render();
                    T = true
                });
                Q.addListener("afterinserthtml",
                function() {
                    clearTimeout(U);
                    U = setTimeout(function() {
                        if (P && (T || Q.ui._isTransfer)) {
                            var X = H.createElement(Q.document, "span", {
                                style: "line-height:0px;",
                                innerHTML: "\ufeff"
                            }),
                            V = Q.selection.getRange();
                            V.insertNode(X);
                            var W = r(X, "firstChild", "previousSibling");
                            P.showAnchor(W.nodeType == 3 ? W.parentNode: W);
                            H.remove(X);
                            delete Q.ui._isTransfer;
                            T = false
                        }
                    },
                    200)
                });
                Q.addListener("contextmenu",
                function(W, V) {
                    s.editor.ui.Popup.postHide(V)
                });
                Q.addListener("keydown",
                function(W, V) {
                    if (P) {
                        P.dispose(V)
                    }
                    var X = V.keyCode || V.which;
                    if (V.altKey && X == 90) {
                        UE.ui.buttons.fullscreen.onclick()
                    }
                });
                Q.addListener("wordcount",
                function(V) {
                    S(this, R)
                });
                function S(Y, ab) {
                    Y.setOpt({
                        wordCount: true,
                        maximumWords: 10000,
                        wordCountMsg: Y.options.wordCountMsg || Y.getLang("wordCountMsg"),
                        wordOverFlowMsg: Y.options.wordOverFlowMsg || Y.getLang("wordOverFlowMsg")
                    });
                    var W = Y.options,
                    V = W.maximumWords,
                    ac = W.wordCountMsg,
                    aa = W.wordOverFlowMsg,
                    X = ab.getDom("wordcount");
                    if (!W.wordCount) {
                        return
                    }
                    var Z = Y.getContentLength(true);
                    if (Z > V) {
                        X.innerHTML = aa;
                        Y.fireEvent("wordcountoverflow")
                    } else {
                        X.innerHTML = ac.replace("{#leave}", V - Z).replace("{#count}", Z)
                    }
                }
                Q.addListener("selectionchange",
                function() {
                    if (Q.options.elementPathEnabled) {
                        R[(Q.queryCommandState("elementpath") == -1 ? "dis": "en") + "ableElementPath"]()
                    }
                    if (Q.options.scaleEnabled) {
                        R[(Q.queryCommandState("scale") == -1 ? "dis": "en") + "ableScale"]()
                    }
                });
                var O = new s.editor.ui.Popup({
                    editor: Q,
                    content: "",
                    className: "edui-bubble",
                    _onEditButtonClick: function() {
                        this.hide();
                        Q.ui._dialogs.linkDialog.open()
                    },
                    _onImgEditButtonClick: function(V) {
                        this.hide();
                        Q.ui._dialogs[V] && Q.ui._dialogs[V].open()
                    },
                    _onImgSetFloat: function(V) {
                        this.hide();
                        Q.execCommand("imagefloat", V)
                    },
                    _setIframeAlign: function(V) {
                        var W = O.anchorEl;
                        var X = W.cloneNode(true);
                        switch (V) {
                            case - 2 : X.setAttribute("align", "");
                                break;
                            case - 1 : X.setAttribute("align", "left");
                                break;
                            case 1:
                                X.setAttribute("align", "right");
                                break
                        }
                        W.parentNode.insertBefore(X, W);
                        H.remove(W);
                        O.anchorEl = X;
                        O.showAnchor(O.anchorEl)
                    },
                    _updateIframe: function() {
                        Q._iframe = O.anchorEl;
                        Q.ui._dialogs.insertframeDialog.open();
                        O.hide()
                    },
                    _onRemoveButtonClick: function(V) {
                        Q.execCommand(V);
                        this.hide()
                    },
                    queryAutoHide: function(V) {
                        if (V && V.ownerDocument == Q.document) {
                            if (V.tagName.toLowerCase() == "img" || H.findParentByTagName(V, "a", true)) {
                                return V !== O.anchorEl
                            }
                        }
                        return s.editor.ui.Popup.prototype.queryAutoHide.call(this, V)
                    }
                });
                O.render();
                if (Q.options.imagePopup) {
                    Q.addListener("mouseover",
                    function(X, V) {
                        V = V || window.event;
                        var Y = V.target || V.srcElement;
                        if (Q.ui._dialogs.insertframeDialog && /iframe/ig.test(Y.tagName)) {
                            var W = O.formatHtml("<nobr>" + Q.getLang("property") + ': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">' + Q.getLang("default") + '</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">' + Q.getLang("justifyleft") + '</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">' + Q.getLang("justifyright") + '</span>&nbsp;&nbsp; <span onclick="$$._updateIframe( this);" class="edui-clickable">' + Q.getLang("modify") + "</span></nobr>");
                            if (W) {
                                O.getDom("content").innerHTML = W;
                                O.anchorEl = Y;
                                O.showAnchor(O.anchorEl)
                            } else {
                                O.hide()
                            }
                        }
                    });
                    Q.addListener("selectionchange",
                    function(ae, Y) {
                        if (!Y) {
                            return
                        }
                        var ab = "",
                        ac = "",
                        aa = Q.selection.getRange().getClosedNode(),
                        W = Q.ui._dialogs;
                        if (aa && aa.tagName == "IMG") {
                            var X = "insertimageDialog";
                            if (aa.className.indexOf("edui-faked-video") != -1) {
                                X = "insertvideoDialog"
                            }
                            if (aa.className.indexOf("edui-faked-webapp") != -1) {
                                X = "webappDialog"
                            }
                            if (aa.src.indexOf("http://api.map.baidu.com") != -1) {
                                X = "mapDialog"
                            }
                            if (aa.className.indexOf("edui-faked-music") != -1) {
                                X = "musicDialog"
                            }
                            if (aa.src.indexOf("http://maps.google.com/maps/api/staticmap") != -1) {
                                X = "gmapDialog"
                            }
                            if (aa.getAttribute("anchorname")) {
                                X = "anchorDialog";
                                ab = O.formatHtml("<nobr>" + Q.getLang("property") + ': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">' + Q.getLang("modify") + "</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">" + Q.getLang("delete") + "</span></nobr>")
                            }
                            if (aa.getAttribute("word_img")) {
                                Q.word_img = [aa.getAttribute("word_img")];
                                X = "wordimageDialog"
                            }
                            if (!W[X]) {
                                return
                            }
                            ac = "<nobr>" + Q.getLang("property") + ': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">' + Q.getLang("default") + '</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">' + Q.getLang("justifyleft") + '</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">' + Q.getLang("justifyright") + '</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">' + Q.getLang("justifycenter") + "</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('" + X + '\');" class="edui-clickable">' + Q.getLang("modify") + "</span></nobr>"; ! ab && (ab = O.formatHtml(ac))
                        }
                        if (Q.ui._dialogs.linkDialog) {
                            var ad = Q.queryCommandValue("link");
                            var V;
                            if (ad && (V = (ad.getAttribute("_href") || ad.getAttribute("href", 2)))) {
                                var Z = V;
                                if (V.length > 30) {
                                    Z = V.substring(0, 20) + "..."
                                }
                                if (ab) {
                                    ab += '<div style="height:5px;"></div>'
                                }
                                ab += O.formatHtml("<nobr>" + Q.getLang("anthorMsg") + ': <a target="_blank" href="' + V + '" title="' + V + '" >' + Z + '</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">' + Q.getLang("modify") + '</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> ' + Q.getLang("clear") + "</span></nobr>");
                                O.showAnchor(ad)
                            }
                        }
                        if (ab) {
                            O.getDom("content").innerHTML = ab;
                            O.anchorEl = aa || ad;
                            O.showAnchor(O.anchorEl)
                        } else {
                            O.hide()
                        }
                    })
                }
            },
            _initToolbars: function() {
                var U = this.editor;
                var W = this.toolbars || [];
                var Q = [];
                for (var T = 0; T < W.length; T++) {
                    var V = W[T];
                    var R = new s.editor.ui.Toolbar({
                        theme: U.options.theme
                    });
                    for (var S = 0; S < V.length; S++) {
                        var O = V[S];
                        var P = null;
                        if (typeof O == "string") {
                            O = O.toLowerCase();
                            if (O == "|") {
                                O = "Separator"
                            }
                            if (s.editor.ui[O]) {
                                P = new s.editor.ui[O](U)
                            }
                            if (O == "fullscreen") {
                                if (Q && Q[0]) {
                                    Q[0].items.splice(0, 0, P)
                                } else {
                                    P && R.items.splice(0, 0, P)
                                }
                                continue
                            }
                        } else {
                            P = O
                        }
                        if (P && P.id) {
                            R.add(P)
                        }
                    }
                    Q[T] = R
                }
                this.toolbars = Q
            },
            getHtmlTpl: function() {
                return '<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">' + (this.toolbars.length ? '<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">' + this.renderToolbarBoxHtml() + "</div></div>": "") + '<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">' + this.editor.getLang("clickToUpload") + '</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'
            },
            showWordImageDialog: function() {
                this.editor.execCommand("wordimage", "word_img");
                this._dialogs.wordimageDialog.open()
            },
            renderToolbarBoxHtml: function() {
                var P = [];
                for (var O = 0; O < this.toolbars.length; O++) {
                    P.push(this.toolbars[O].renderHtml())
                }
                return P.join("")
            },
            setFullScreen: function(T) {
                var S = this.editor,
                Q = S.container.parentNode.parentNode;
                if (this._fullscreen != T) {
                    this._fullscreen = T;
                    this.editor.fireEvent("beforefullscreenchange", T);
                    if (s.editor.browser.gecko) {
                        var P = S.selection.getRange().createBookmark()
                    }
                    if (T) {
                        while (Q.tagName != "BODY") {
                            var O = s.editor.dom.domUtils.getComputedStyle(Q, "position");
                            L.push(O);
                            Q.style.position = "static";
                            Q = Q.parentNode
                        }
                        this._bakHtmlOverflow = document.documentElement.style.overflow;
                        this._bakBodyOverflow = document.body.style.overflow;
                        this._bakAutoHeight = this.editor.autoHeightEnabled;
                        this._bakScrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
                        this._bakEditorContaninerWidth = S.iframe.parentNode.offsetWidth;
                        if (this._bakAutoHeight) {
                            S.autoHeightEnabled = false;
                            this.editor.disableAutoHeight()
                        }
                        document.documentElement.style.overflow = "hidden";
                        document.body.style.overflow = "hidden";
                        this._bakCssText = this.getDom().style.cssText;
                        this._bakCssText1 = this.getDom("iframeholder").style.cssText;
                        S.iframe.parentNode.style.width = "";
                        this._updateFullScreen()
                    } else {
                        while (Q.tagName != "BODY") {
                            Q.style.position = L.shift();
                            Q = Q.parentNode
                        }
                        this.getDom().style.cssText = this._bakCssText;
                        this.getDom("iframeholder").style.cssText = this._bakCssText1;
                        if (this._bakAutoHeight) {
                            S.autoHeightEnabled = true;
                            this.editor.enableAutoHeight()
                        }
                        document.documentElement.style.overflow = this._bakHtmlOverflow;
                        document.body.style.overflow = this._bakBodyOverflow;
                        S.iframe.parentNode.style.width = this._bakEditorContaninerWidth + "px";
                        window.scrollTo(0, this._bakScrollTop)
                    }
                    if (s.editor.browser.gecko && S.body.contentEditable === "true") {
                        var R = document.createElement("input");
                        document.body.appendChild(R);
                        S.body.contentEditable = false;
                        setTimeout(function() {
                            R.focus();
                            setTimeout(function() {
                                S.body.contentEditable = true;
                                S.selection.getRange().moveToBookmark(P).select(true);
                                s.editor.dom.domUtils.remove(R);
                                T && window.scroll(0, 0)
                            },
                            0)
                        },
                        0)
                    }
                    if (S.body.contentEditable === "true") {
                        this.editor.fireEvent("fullscreenchanged", T);
                        this.triggerLayout()
                    }
                }
            },
            _updateFullScreen: function() {
                if (this._fullscreen) {
                    var O = K.getViewportRect();
                    this.getDom().style.cssText = "border:0;position:absolute;left:0;top:" + (this.editor.options.topOffset || 0) + "px;width:" + O.width + "px;height:" + O.height + "px;z-index:" + (this.getDom().style.zIndex * 1 + 100);
                    K.setViewportOffset(this.getDom(), {
                        left: 0,
                        top: this.editor.options.topOffset || 0
                    });
                    this.editor.setHeight(O.height - this.getDom("toolbarbox").offsetHeight - this.getDom("bottombar").offsetHeight - (this.editor.options.topOffset || 0));
                    if (E.gecko) {
                        window.onresize()
                    }
                }
            },
            _updateElementPath: function() {
                var O = this.getDom("elementpath"),
                R;
                if (this.elementPathEnabled && (R = this.editor.queryCommandValue("elementpath"))) {
                    var S = [];
                    for (var Q = 0,
                    P; P = R[Q]; Q++) {
                        S[Q] = this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;' + Q + '&quot;);">' + P + "</span>")
                    }
                    O.innerHTML = '<div class="edui-editor-breadcrumb" onmousedown="return false;">' + this.editor.getLang("elementPathTip") + ": " + S.join(" &gt; ") + "</div>"
                } else {
                    O.style.display = "none"
                }
            },
            disableElementPath: function() {
                var O = this.getDom("elementpath");
                O.innerHTML = "";
                O.style.display = "none";
                this.elementPathEnabled = false
            },
            enableElementPath: function() {
                var O = this.getDom("elementpath");
                O.style.display = "";
                this.elementPathEnabled = true;
                this._updateElementPath()
            },
            _scale: function() {
                var ai = document,
                S = this.editor,
                ag = S.container,
                Q = S.document,
                U = this.getDom("toolbarbox"),
                V = this.getDom("bottombar"),
                ah = this.getDom("scale"),
                ae = this.getDom("scalelayer");
                var Y = false,
                af = null,
                T = 0,
                ac = S.options.minFrameWidth,
                P = 0,
                O = 0,
                ab = 0,
                R = 0;
                function X() {
                    af = H.getXY(ag);
                    if (!T) {
                        T = S.options.minFrameHeight + U.offsetHeight + V.offsetHeight
                    }
                    ae.style.cssText = "position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:" + ag.offsetWidth + "px;height:" + ag.offsetHeight + "px;z-index:" + (S.options.zIndex + 1);
                    H.on(ai, "mousemove", Z);
                    H.on(Q, "mouseup", W);
                    H.on(ai, "mouseup", W)
                }
                var ad = this;
                this.editor.addListener("fullscreenchanged",
                function(al, aj) {
                    if (aj) {
                        ad.disableScale()
                    } else {
                        if (ad.editor.options.scaleEnabled) {
                            ad.enableScale();
                            var ak = ad.editor.document.createElement("span");
                            ad.editor.body.appendChild(ak);
                            ad.editor.body.style.height = Math.max(H.getXY(ak).y, ad.editor.iframe.offsetHeight - 20) + "px";
                            H.remove(ak)
                        }
                    }
                });
                function Z(aj) {
                    aa();
                    var ak = aj || window.event;
                    P = ak.pageX || (ai.documentElement.scrollLeft + ak.clientX);
                    O = ak.pageY || (ai.documentElement.scrollTop + ak.clientY);
                    ab = P - af.x;
                    R = O - af.y;
                    if (ab >= ac) {
                        Y = true;
                        ae.style.width = ab + "px"
                    }
                    if (R >= T) {
                        Y = true;
                        ae.style.height = R + "px"
                    }
                }
                function W() {
                    if (Y) {
                        Y = false;
                        S.ui._actualFrameWidth = ae.offsetWidth - 2;
                        ag.style.width = S.ui._actualFrameWidth + "px";
                        S.setHeight(ae.offsetHeight - V.offsetHeight - U.offsetHeight - 2)
                    }
                    if (ae) {
                        ae.style.display = "none"
                    }
                    aa();
                    H.un(ai, "mousemove", Z);
                    H.un(Q, "mouseup", W);
                    H.un(ai, "mouseup", W)
                }
                function aa() {
                    if (E.ie) {
                        ai.selection.clear()
                    } else {
                        window.getSelection().removeAllRanges()
                    }
                }
                this.enableScale = function() {
                    if (S.queryCommandState("source") == 1) {
                        return
                    }
                    ah.style.display = "";
                    this.scaleEnabled = true;
                    H.on(ah, "mousedown", X)
                };
                this.disableScale = function() {
                    ah.style.display = "none";
                    this.scaleEnabled = false;
                    H.un(ah, "mousedown", X)
                }
            },
            isFullScreen: function() {
                return this._fullscreen
            },
            postRender: function() {
                M.prototype.postRender.call(this);
                for (var Q = 0; Q < this.toolbars.length; Q++) {
                    this.toolbars[Q].postRender()
                }
                var R = this;
                var P, O = s.editor.dom.domUtils,
                S = function() {
                    clearTimeout(P);
                    P = setTimeout(function() {
                        R._updateFullScreen()
                    })
                };
                O.on(window, "resize", S);
                R.addListener("destroy",
                function() {
                    O.un(window, "resize", S);
                    clearTimeout(P)
                })
            },
            showToolbarMsg: function(Q, P) {
                this.getDom("toolbarmsg_label").innerHTML = Q;
                this.getDom("toolbarmsg").style.display = "";
                if (!P) {
                    var O = this.getDom("upload_dialog");
                    O.style.display = "none"
                }
            },
            hideToolbarMsg: function() {
                this.getDom("toolbarmsg").style.display = "none"
            },
            mapUrl: function(O) {
                return O ? O.replace("~/", this.editor.options.UEDITOR_HOME_URL || "") : ""
            },
            triggerLayout: function() {
                var O = this.getDom();
                if (O.style.zoom == "1") {
                    O.style.zoom = "100%"
                } else {
                    O.style.zoom = "1"
                }
            }
        };
        I.inherits(J, s.editor.ui.UIBase);
        var N = {};
        UE.ui.Editor = function(O) {
            var Q = new s.editor.Editor(O);
            Q.options.editor = Q;
            if (Q.options.themePath !== null) {
                I.loadFile(document, {
                    href: Q.options.themePath + Q.options.theme + "/_css/ueditor.css",
                    tag: "link",
                    type: "text/css",
                    rel: "stylesheet"
                })
            }
            var P = Q.render;
            Q.render = function(R) {
                if (R.constructor === String) {
                    Q.key = R;
                    N[R] = Q
                }
                Q.langIsReady ? S() : Q.addListener("langReady", S);
                function S() {
                    Q.setOpt({
                        labelMap: Q.options.labelMap || Q.getLang("labelMap")
                    });
                    new J(Q.options);
                    if (R) {
                        if (R.constructor === String) {
                            R = document.getElementById(R)
                        }
                        R && R.getAttribute("name") && (Q.options.textarea = R.getAttribute("name"));
                        if (R && /script|textarea/ig.test(R.tagName)) {
                            var Z = document.createElement("div");
                            R.parentNode.insertBefore(Z, R);
                            var T = R.value || R.innerHTML;
                            Q.options.initialContent = /^[\t\r\n ]*$/.test(T) ? Q.options.initialContent: T.replace(/>[\n\r\t]+([ ]{4})+/g, ">").replace(/[\n\r\t]+([ ]{4})+</g, "<").replace(/>[\n\r\t]+</g, "><");
                            R.className && (Z.className = R.className);
                            R.style.cssText && (Z.style.cssText = R.style.cssText);
                            if (/textarea/i.test(R.tagName)) {
                                Q.textarea = R;
                                Q.textarea.style.display = "none"
                            } else {
                                R.parentNode.removeChild(R);
                                R.id && (Z.id = R.id)
                            }
                            R = Z;
                            R.innerHTML = ""
                        }
                    }
                    H.addClass(R, "edui-" + Q.options.theme);
                    Q.ui.render(R);
                    var Y = Q.options;
                    Q.container = Q.ui.getDom();
                    var V = H.findParents(R, true);
                    var U = [];
                    for (var X = 0,
                    W; W = V[X]; X++) {
                        U[X] = W.style.display;
                        W.style.display = "block"
                    }
                    if (Y.initialFrameWidth) {
                        Y.minFrameWidth = Y.initialFrameWidth
                    } else {
                        Y.minFrameWidth = Y.initialFrameWidth = R.offsetWidth
                    }
                    if (Y.initialFrameHeight) {
                        Y.minFrameHeight = Y.initialFrameHeight
                    } else {
                        Y.initialFrameHeight = Y.minFrameHeight = R.offsetHeight
                    }
                    for (var X = 0,
                    W; W = V[X]; X++) {
                        W.style.display = U[X]
                    }
                    if (R.style.height) {
                        R.style.height = ""
                    }
                    Q.container.style.width = Y.initialFrameWidth + "px";
                    Q.container.style.zIndex = Y.zIndex;
                    P.call(Q, Q.ui.getDom("iframeholder"))
                }
            };
            return Q
        };
        UE.getEditor = function(Q, O) {
            var P = N[Q];
            if (!P) {
                P = N[Q] = new UE.ui.Editor(O);
                P.render(Q)
            }
            return P
        };
        UE.delEditor = function(P) {
            var O;
            if (O = N[P]) {
                O.key && O.destroy();
                delete N[P]
            }
        }
    })(); UE.plugins.iknowFilter = function() {
        this.addOutputRule(function(H) {
            H.traversal(function(K) {
                switch (K.tagName) {
                    case "img":
                        var J = K.getAttr("src"),
                        I = K.getAttr("_src");
                        K.setAttr();
                        J && K.setAttr("src", J);
                        I && K.setAttr("_src", I);
                        break
                }
            })
        })
    }; a = UE.ui.Editor; a.config = G
})();
    return a
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/store/store.js", "/static/common/ui/editor/config/config.js", "/static/common/ui/editor/lang/lang.js", "/static/common/ui/dialog/dialog.js", "/static/common/ui/event/event.js", "/static/common/ui/tip/tip.js", "/static/common/ui/editor/fileUploader/fileUploader.js"]);
F.module("/static/common/ui/editor/prototype/prototype.js",
function(f, c) {
    var e = f("/static/common/lib/tangram/base/base.js");
    var b = f("/static/common/ui/dialog/dialog.js");
    var d = f("/static/common/ui/event/event.js");
    var a = f("/static/common/ui/util/util.js");
    var g = f("/static/common/ui/log/log.js");
    c = {
        pageUnload: function(i) {
            var h = this,
            k = this.instance;
            if ( !! h.config.optionList.modify && h.hasCon()) {
                var j = "\u8bf7\u6ce8\u610f\uff1a\u60a8\u7684\u7f16\u8f91\u5185\u5bb9\u8fd8\u6ca1\u6709\u8fdb\u884c\u4fdd\u5b58!";
                i.returnValue = j;
                return j
            }
        },
        filterTag: function(j, i) {
            var k = i || "<p><br /></p>",
            h = j.toLocaleLowerCase().lastIndexOf(k);
            if (h > 0 && (j.length == h + k.length)) {
                return j.substring(0, h)
            }
            return j
        },
        hasCon: function() {
            var h = this,
            i = this.instance;
            if (i.getContentTxt().length > 0 && i.getContentTxt() != i.options.initialContent) {
                return true
            } else {
                return /<(?:img|iframe)\s+(?:[^>]+\s+)*src\s*=\s*("|')+[^\1]+\1+\s*\/*>/i.test(i.getContent())
            }
        },
        checkEditor: function() {
            var j = this,
            l = this.instance,
            i = this.hasCon(),
            m = false;
            if (e.type(l.getUploadFile) == "function" && l.getUploadFile().status != "ready") {
                var k = l.getUploadFile();
                if (! (k.status == "complete" && k.fileInfo && k.fileInfo.fs_id)) {
                    var h;
                    if (!/(complete|error)/.test(k.status)) {
                        h = 0
                    } else {
                        h = 1
                    }
                    setTimeout(function() {
                        e(".edui-editor-wordcount", l.container).eq(0).html("<span class='f-red' style='direction: none'>" + j.config.fileErrorNum[h] + "</span> ");
                        e(".edui-editor-bottomContainer", l.container).show()
                    },
                    100);
                    return false
                } else {
                    m = true
                }
            }
            if (!i && !m) {
                l.focus();
                setTimeout(function() {
                    e(".edui-editor-wordcount", l.container).eq(0).html("<span class='f-red' style='direction: none'>" + j.config.optionList.errorClew[0] + "</span> ");
                    e(".edui-editor-bottomContainer", l.container).show()
                },
                100);
                return false
            }
            if (l.hasWordOverflow()) {
                setTimeout(function() {
                    e(".edui-editor-bottomContainer", l.container).show()
                },
                100);
                return false
            }
            return true
        },
        uploadFile: function(h) {
            var i = this,
            k = this.instance;
            if (e.type(k.getUploadFile) == "function") {
                var j = k.getUploadFile();
                if (e.type(k.uploadAction) == "function") {
                    k.uploadAction("submit")
                }
                if (!i.hasCon()) {
                    h = ""
                }
                if (j.status == "complete") {
                    h += ('<file fsid="' + j.fileInfo.fs_id + '" wealth="' + j.fileInfo.wealth + '" />')
                }
            }
            return h
        },
        formatEnter: function(l) {
            var k = "",
            j = l.replace(/<br\s*\/*>/ig, "\n").replace(/ /g, "&nbsp;").replace(/\r\n/g, "\n").split("\n");
            for (var h = 0; h < j.length; h++) {
                if (e.string(j[h]).trim() != "") {
                    k += "<p>" + e.string(j[h]).trim() + "</p>"
                } else {
                    k += "<p><br /></p>"
                }
            }
            return k
        },
        formatMapContent: function(i) {
            var h = this.unHtml(i).replace("\r\n", "\n").split("\n");
            return "<p>" + h.join("</p><p>") + "</p>"
        },
        unHtml: function(h) {
            return h ? h.replace(/[&<\">]/g,
            function(i) {
                return {
                    "<": "&lt;",
                    "&": "&amp",
                    '"': "&quot;",
                    ">": "&gt;"
                } [i]
            }) : ""
        },
        filterMapClew: function(n, k) {
            if (!n) {
                return ""
            }
            n = n.replace(/<a[^>]*>([\S\s]*?)<\s*\/\s*a\s*>/ig,
            function(r, q) {
                if (/<img[^>]*>/i.test(q)) {
                    return q
                }
                return r
            });
            var h = new RegExp("<iframe.+?></iframe>", "ig");
            var i = h.exec(n);
            if (!i) {
                return n
            }
            var j = i[0];
            this.config.optionList.pic = true;
            var m = "",
            p = "";
            if ((i = j.match(/src="(.+?)"/i))) {
                m = i[1]
            }
            if ((i = j.match(/map="(.+?)"/i))) {
                p = i[1]
            }
            if (!m) {
                m = "http://map.baidu.com/" + p
            } else {
                m = m.replace(/^.+?html\/map/ig, "http://map.baidu.com/iknow")
            }
            if (k == true) {
                m = m.replace("http://map.baidu.com/iknow", "http://zhidao.baidu.com/html/map")
            }
            var l = '<iframe data-type="map" map="' + m + '" frameborder="0" src="' + m + '" class="ikqb-mapshow"></iframe>';
            var o = n.replace(h, l);
            o = this.filterTag(o);
            return o
        },
        filterHighlight: function(h) {
            if (!h) {
                return ""
            }
            var j = /<pre(.*?)>([\s\S]+?)<\/pre>/g,
            i = h.match(j);
            if (!i) {
                return h
            }
            return h.replace(j,
            function(l, k, n) {
                var m = k && k.match(/class="brush:\s*(.+?);.*?"/);
                if (m && m[1]) {
                    return '<pre t="code" l="' + m[1] + '">' + n + "</pre>"
                } else {
                    return n
                }
            })
        },
        formatCode: function(h) {
            if (!h) {
                return ""
            }
            var j = /<pre(.*?)>([\s\S]+?)<\/pre>/g,
            i = h.match(j);
            if (!i) {
                return h
            }
            return h.replace(j,
            function(l, k, n) {
                var m = k && k.match(/t="code" l="\s*(.+?)"/);
                if (m && m[1]) {
                    return '<pre class="brush:' + m[1] + ';toolbar:false">' + n + "</pre>"
                } else {
                    return n
                }
            })
        },
        collapseEditor: function(i, l) {
            var n = this,
            k = e(n.container);
            n.config.optionList.modify = false;
            if (e.browser.firefox) {
                var j = n.instance.container,
                o = e(".addons", k.get(0)),
                h = e(".edui-editor-iframeholder", j),
                i = 190;
                var m = setInterval(function() {
                    i = i - 20;
                    h.css("height", i + "px");
                    if (i < 20) {
                        clearInterval(m);
                        e(j).css("height", "0");
                        o.hide();
                        k.css({
                            visibility: "hidden",
                            height: "0"
                        });
                        n.fire("oncollapse")
                    }
                },
                20)
            } else {
                if (e.browser.ie && e.browser.ie < 7) {
                    setTimeout(function() {
                        k.find("iframe").first().hide()
                    },
                    100)
                }
                k.css({
                    overflow: "hidden",
                    visibility: "visible",
                    height: "auto"
                });
                var m = setInterval(function() {
                    i = i - 20;
                    k.css("height", i + "px");
                    if (i < 20) {
                        clearInterval(m);
                        k.css({
                            overflow: "hidden",
                            visibility: "hidden",
                            height: "0"
                        });
                        n.fire("oncollapse")
                    }
                },
                20)
            }
        },
        expandEditor: function(i) {
            var n = this,
            k = e(this.container);
            if (e.browser.firefox) {
                var j = n.instance.container,
                o = e(".addons", k.get(0)).show();
                e(j).css("height", "");
                var i = 190,
                m = 0,
                h = e(".edui-editor-iframeholder", j);
                var l = setInterval(function() {
                    m = m + 20;
                    h.css("height", m + "px");
                    if (m > i) {
                        clearInterval(l);
                        h.css("height", "190px");
                        n.fire("onexpand")
                    }
                },
                20);
                e(k).css("height", "").css("visibility", "visible")
            } else {
                k.css("display", "").css({
                    overflow: "hidden",
                    visibility: "visible",
                    height: "0"
                });
                var m = 0;
                var l = setInterval(function() {
                    m = m + 20;
                    k.css("height", m + "px");
                    if (m > i) {
                        clearInterval(l);
                        k.css("height", "").css({
                            overflow: "visible"
                        });
                        if (e.browser.ie && e.browser.ie < 7) {
                            k.find("iframe").first().show()
                        }
                        n.fire("onexpand")
                    }
                },
                20)
            }
        },
        setContent: function(j, h) {
            var i = this;
            setTimeout(function() {
                if (j != "") {
                    if (h == "0") {
                        j = i.formatEnter(j)
                    }
                    j = i.formatCode(i.filterMapClew(j, true));
                    i.instance.setContent(j, false, true)
                }
                i.instance.focus()
            },
            500)
        },
        afterInit: function() {
            var i = this,
            h = this.instance,
            k = false;
            function j(m, l) {
                new b({
                    type: "alert",
                    titleText: m,
                    content: l,
                    width: 350,
                    height: 160,
                    autoRender: true
                })
            }
            h.addListener("uploadSuccess",
            function(l, m) {
                if (m.errorNo != "0") {
                    j("\u63d2\u5165\u56fe\u7247", i.config.imgErrorNum[m.errorNo])
                } else {
                    h.focus()
                }
            });
            h.addListener("networkError",
            function() {
                j("\u63d2\u5165\u56fe\u7247", "<div class='ik-neweditor-clewservice'>\u672a\u77e5\u9519\u8bef</div>")
            });
            h.addListener("imageSizeError",
            function(l, m) {
                j("\u63d2\u5165\u56fe\u7247", '<p class="ik-neweditor-clew">\u56fe\u7247\u6587\u4ef6\u8fc7\u5927\uff01</p><p class="ik-neweditor-clewmore">\u6ce8\uff1a\u5927\u5c0f\u4e0d\u8d85\u8fc75M\uff0c\u652f\u6301JPG/PNG/BMP/GIF\u7b49\u683c\u5f0f</p>')
            });
            h.addListener("showmap",
            function() {
                if (h.options.isLogin) {
                    var l = new b({
                        contentType: "frame",
                        content: i.config.buttonConfig.insertmap.url + "?editor=" + i.guid,
                        titleText: "\u63d2\u5165\u5730\u56fe",
                        width: 710,
                        height: 480,
                        autoDispose: true
                    })
                }
            });
            h.addListener("showhighlightcode",
            function() {
                if (h.options.isLogin) {
                    var l = new b({
                        contentType: "frame",
                        content: i.config.buttonConfig.highlightcode.url + "?editor=" + i.guid,
                        titleText: "\u63d2\u5165\u4ee3\u7801",
                        width: 550,
                        height: 440,
                        autoDispose: true,
                        type: "confirm",
                        onaccept: function() {
                            var o = e(l.getElement("content")).find("iframe")[0].contentWindow,
                            m = o.document.getElementById("code").value,
                            n = o.document.getElementById("language").value;
                            h.execCommand("highlightcode", m, n);
                            l.hide()
                        }
                    })
                }
            });
            d.on("editor-" + i.guid + ".setmap",
            function(n, m) {
                var o = i.instance;
                d.fire("dialog.close");
                if (!e.isObject(m)) {
                    n.returnValue = false;
                    return
                }
                if (m.url) {
                    var l = '<p><iframe data-type="map" map="' + m.url + '" frameborder="0" src="' + m.url + '" class="ikqb-mapshow"></iframe></p>';
                    o.execCommand("insertHTML", l)
                }
                if (m.info != "") {
                    m.info = "<p>" + i.formatMapContent(decodeURIComponent(m.info)) + "</p>";
                    o.execCommand("insertHTML", m.info)
                }
                o.focus()
            });
            d.on("editor.default",
            function() {
                i.config.optionList.modify = false;
                k = true
            });
            h.addListener("focus",
            function() {
                e(this.container).parent().addClass("editor-focus");
                if (!k) {
                    i.config.optionList.modify = true
                }
            });
            h.addListener("blur",
            function() {
                e(this.container).parent().removeClass("editor-focus")
            });
            if (e.browser.isWebkit) {
                window.addEventListener("beforeunload",
                function(l) {
                    return i.pageUnload(l)
                })
            } else {
                window.onbeforeunload = function(l) {
                    l = l || window.event;
                    i.pageUnload(l)
                }
            }
        }
    };
    return c
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/dialog/dialog.js", "/static/common/ui/event/event.js", "/static/common/ui/util/util.js", "/static/common/ui/log/log.js"]);
F.module("/static/common/ui/editor/ueditor-src/_src/ui/ui.js",
function(c, a) {
    var b = b || {};
    b.editor = b.editor || {};
    b.editor.ui = {};
    return a
},
[]);